root/include/asm-m68k/processor.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. start_thread
  2. thread_saved_pc

   1 /*
   2  * include/asm-m68k/processor.h
   3  *
   4  * Copyright (C) 1995 Hamish Macdonald
   5  */
   6 
   7 #ifndef __ASM_M68K_PROCESSOR_H
   8 #define __ASM_M68K_PROCESSOR_H
   9 
  10 #include <asm/segment.h>
  11 
  12 /*
  13  * User space process size: 3.75GB. This is hardcoded into a few places,
  14  * so don't change it unless you know what you are doing.
  15  */
  16 #define TASK_SIZE       (0xF0000000UL)
  17 
  18 /*
  19  * Bus types
  20  */
  21 #define EISA_bus__is_a_macro    1
  22 #define EISA_bus 0
  23 #define MCA_bus__is_a_macro     1
  24 #define MCA_bus 0
  25 
  26 /*
  27  * The m68k has no problems with write protection
  28  */
  29 #define wp_works_ok__is_a_macro 1
  30 #define wp_works_ok 1
  31 
  32 /* MAX floating point unit state size (FSAVE/FRESTORE) */
  33 #define FPSTATESIZE   (216/sizeof(unsigned short))
  34 
  35 /* 
  36  * if you change this structure, you must change the code and offsets
  37  * in m68k/machasm.S
  38  */
  39    
  40 struct thread_struct {
  41         unsigned long  ksp;             /* kernel stack pointer */
  42         unsigned long  usp;             /* user stack pointer */
  43         unsigned short sr;              /* saved status register */
  44         unsigned short fs;              /* saved fs (sfc, dfc) */
  45         unsigned long  *pagedir_v;      /* root page table virtual addr */
  46         unsigned long  pagedir_p;       /* root page table physaddr */
  47         unsigned long  crp[2];          /* cpu root pointer */
  48         unsigned long  esp0;            /* points to SR of stack frame */
  49         unsigned long  fp[8*3];
  50         unsigned long  fpcntl[3];       /* fp control regs */
  51         unsigned short fpstate[FPSTATESIZE];  /* floating point state */
  52 };
  53 
  54 #define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
  55 
  56 #define INIT_TSS  { \
  57         sizeof(init_kernel_stack) + (long) init_kernel_stack, 0, \
  58         PS_S, KERNEL_DS, \
  59         NULL, 0, {0, 0}, 0 \
  60 }
  61 
  62 #define alloc_kernel_stack()    get_free_page(GFP_KERNEL)
  63 #define free_kernel_stack(page) free_page((page))
  64 
  65 /*
  66  * Do necessary setup to start up a newly executed thread.
  67  */
  68 static inline void start_thread(struct pt_regs * regs, unsigned long pc,
     /* [previous][next][first][last][top][bottom][index][help] */
  69                                 unsigned long usp)
  70 {
  71         unsigned long nilstate = 0;
  72 
  73         /* clear floating point state */
  74         __asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate));
  75 
  76         /* reads from user space */
  77         set_fs(USER_DS);
  78 
  79         regs->pc = pc;
  80         regs->sr &= ~0x2000;
  81         wrusp(usp);
  82 }
  83 
  84 /*
  85  * Return saved PC of a blocked thread.
  86  */
  87 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
     /* [previous][next][first][last][top][bottom][index][help] */
  88 {
  89         return ((unsigned long *)((struct switch_stack *)t->ksp)->a6)[1];
  90 }
  91 
  92 #endif

/* [previous][next][first][last][top][bottom][index][help] */