root/include/asm-sparc/processor.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. start_bh_atomic
  2. end_bh_atomic

   1 /* include/asm-sparc/processor.h
   2  *
   3  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
   4  */
   5 
   6 #ifndef __ASM_SPARC_PROCESSOR_H
   7 #define __ASM_SPARC_PROCESSOR_H
   8 
   9 /*
  10  * Bus types
  11  */
  12 extern int EISA_bus;
  13 #define MCA_bus 0
  14 
  15 /*
  16  * User space process size: 3GB. This is hardcoded into a few places,
  17  * so don't change it unless you know what you are doing.
  18  *
  19  * "this is gonna have to change to 1gig for the sparc" - David S. Miller
  20  */
  21 #define TASK_SIZE       (0xc0000000UL)
  22 
  23 /*
  24  * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
  25  */
  26 #define IO_BITMAP_SIZE  32
  27 
  28 /* The first five entries here MUST be the first four. This allows me to
  29  * do %lo(offset) loads and stores in entry.S. See TRAP_WIN_CLEAN to see
  30  * why.
  31  */
  32 
  33 struct thread_struct {
  34         unsigned long uwindows;       /* how many user windows are in the set */
  35         unsigned long wim;            /* user's window invalid mask */
  36         unsigned long w_saved;        /* how many windows saved in reg_window[] */
  37         unsigned long ksp;          /* kernel stack pointer */
  38         unsigned long usp;          /* user's sp, throw reg windows here */
  39         unsigned long psr;          /* save for condition codes */
  40         unsigned long reg_window[16*24];
  41         unsigned long cr3;          /* why changed from ptbr? */
  42         unsigned int pcc;
  43         unsigned int asn;
  44         unsigned long unique;
  45         unsigned long flags;
  46         unsigned long res1, res2;
  47         unsigned long pc;           /* program counter */
  48         unsigned long npc;          /* next program counter */
  49 
  50 /* 8 local registers + 8 in registers * 24 register windows.
  51  * Most sparc's I know of only have 8 windows implemented,
  52  * we determine how many at boot time and store that value
  53  * in nwindows.
  54  */
  55         unsigned long globl_regs[8];  /* global regs need to be saved too */
  56         unsigned long yreg;
  57         unsigned long float_regs[64]; /* V8 and below have 32, V9 has 64 */
  58 };
  59 
  60 #define INIT_TSS  { \
  61         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  62         0, 0, 0, 0, 0, 0, 0, 0, \
  63         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  64         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  65         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  66         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  67         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  68         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  69         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  70         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  71         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  72         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  73         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  74         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  75         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  76         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  77         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  78         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  79         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  80         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  81         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  82         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  83         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  84         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  85         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  86         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
  87         0, 0, 0, 0, \
  88         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  89         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  90         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  91         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
  92 }
  93 
  94 /* The thread_frame is what needs to be set up in certain circumstances
  95  * upon entry to a trap. It is also loaded sometimes during a window
  96  * spill if things don't go right (bad user stack pointer). In reality
  97  * it is not per-process per se, it just sits in the kernel stack while
  98  * the current process is in a handler then it is basically forgotten
  99  * about.
 100  */
 101 
 102 struct thread_frame {
 103   unsigned int thr_psr;
 104   unsigned int thr_pc;
 105   unsigned int thr_npc;
 106   unsigned int thr_y;
 107   unsigned int thr_globals[8];
 108   unsigned int thr_outs[8];
 109 };
 110 
 111 /*
 112  * These are the "cli()" and "sti()" for software interrupts
 113  * They work by increasing/decreasing the "intr_count" value, 
 114  * and as such can be nested arbitrarily.
 115  */
 116 extern inline void start_bh_atomic(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 117 {
 118         unsigned long dummy, psr;
 119         __asm__ __volatile__("rd %%psr, %2\n\t"
 120                              "wr %2, 0x20, %%psr\n\t"  /* disable traps */
 121                              "ld %1,%0\n\t"
 122                              "add %0,1,%0\n\t"
 123                              "st %0,%1\n\t"
 124                              "wr %2, 0x0, %%psr\n\t"   /* enable traps */
 125                              : "=r" (dummy), "=m" (intr_count)
 126                              : "0" (0), "r" (psr=0));
 127 }
 128 
 129 extern inline void end_bh_atomic(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 130 {
 131         unsigned long dummy, psr;
 132         __asm__ __volatile__("rd %%psr, %2\n\t"
 133                              "wr %2, 0x20, %%psr\n\t"
 134                              "ld %1,%0\n\t"
 135                              "sub %0,1,%0\n\t"
 136                              "st %0,%1\n\t"
 137                              "wr %2, 0x0, %2\n\t"
 138                              : "=r" (dummy), "=m" (intr_count)
 139                              : "0" (0), "r" (psr=0));
 140 }
 141 
 142 #endif /* __ASM_SPARC_PROCESSOR_H */
 143 

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