root/arch/sparc/kernel/entry.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* arch/sparc/kernel/entry.S:  Sparc trap low-level entry points.
   2  *
   3  * Sparc traps are so ugly, this code is going to go through a lot
   4  * of changes as I find out more interesting things. See head.S for
   5  * the trap table and how it works, this will show you how we get
   6  * to these routines.
   7  *
   8  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
   9  */
  10 
  11 #include <asm/head.h>
  12 #include <asm/asi.h>
  13 #include <asm/cprefix.h>
  14 
  15 /* Here are macros for routines we do often, this allows me to inline this
  16  * without making the code look real ugly. Well, the macro looks ugly too but
  17  * makes the trap entry code easier to understand.
  18  */
  19 
  20 /* I really don't like synthetic instructions. So I avoid them like the
  21  * plague.
  22  */
  23 
  24 /* Note that when I have to write a window out, and it is a user's window, I
  25  * have to check that the pages of memory that I am going to throw the window(s)
  26  * onto are valid and are writable by the user (this is %sp to %sp + 64) before
  27  * I start dumping stuff there. We always assume that kernels stack is ok.
  28  *
  29  * If we have to save a kernel window, only one branch is taken. This should
  30  * make trap handlers quicker in this scenario.
  31  *
  32  * Once 'current' is loaded into %g6, it stays there until we leave
  33  * this macro.
  34  *
  35  * XXX must do some checking on the assumption that kernel stack is always ok
  36  */
  37 
  38 /* I will document how this works real soon. TODO */
  39 
  40 #define TRAP_WIN_CLEAN \
  41         or      %g0, %g5, %l5;    /* we need the globals to do our work */ \
  42         or      %g0, %g6, %l6;    /* and %l0 to %l4 are loaded with important */ \
  43         or      %g0, %g7, %l7;    /* information like the psr and pc's to return to */ \
  44         sethi   %hi( C_LABEL(current) ), %g6; \
  45         ld      [%g6 + %lo( C_LABEL(current) )], %g6; \
  46         ld      [%g6 + THREAD_UWINDOWS], %g7; /* how many user wins are active? */ \
  47         subcc   %g7, 0x0, %g0; \
  48         bne     2f;                            /* If there are any, branch. */ \
  49         save    %g0, %g0, %g0;                 /* Save into that window either way. */ \
  50         std     %l0, [%sp];                    /* If above shows only kernel windows */ \
  51 1:      std     %l2, [%sp + 0x8];              /* then we get here. */ \
  52         std     %l4, [%sp + 0x10]; \
  53         std     %l6, [%sp + 0x18]; \
  54         std     %i0, [%sp + 0x20]; \
  55         std     %i2, [%sp + 0x28]; \
  56         std     %i4, [%sp + 0x30]; \
  57         std     %i6, [%sp + 0x38]; \
  58         or      %g0, 0x1, %g5; \
  59         rd      %psr, %g7; \
  60         sll     %g5, %g7, %g5; \
  61         wr      %g5, 0x0, %wim;                 /* update %wim to 'now' invalid */ \
  62         and     %g7, 0x1f, %g7; \
  63         st      %g7, [%g6 + THREAD_WIM];        /* save 'this' threads mask */ \
  64         restore %g0, %g0, %g0; \
  65         or      %g0, %l5, %g5;                  /* restore the globals we used */ \
  66         or      %g0, %l6, %g6; \
  67         b       8f;                             /* we are done */ \
  68         or      %g0, %l7, %g7; \
  69 2:      sub     %g7, 0x1, %g7; \
  70         st      %g7, [%g6 + THREAD_UWINDOWS];   /* There are user windows if we */ \
  71         andcc   %sp, 0x7, %g0;                  /* get here. Check for stack alignment. */ \
  72         bne     5f;                             /* Stack is unaligned, yuck. */ \
  73         sra     %sp, 0x1e, %g7;                 /* This stuff checks to see if top 3-bits */ \
  74         subcc   %g7, 0x0, %g0;                  /* of stack pointer address are ok. */ \
  75         be,a    3f; \
  76         andn    %sp, 0xfff, %g7; \
  77         subcc   %g7, -1, %g0; \
  78         bne     5f;                             /* bad stack pointer, ugh */ \
  79         andn    %sp, 0xfff, %g7; \
  80 3:      lda     [%g7] ASI_PTE, %g7;             /* Ok, user stack is a valid address */ \
  81         srl     %g7, 0x1d, %g7; \
  82         subcc   %g7, 0x6, %g0;                  /* Can the user write to it? */ \
  83         bne     5f; \
  84         and     %sp, 0xfff, %g7; \
  85         subcc   %g7, 0xfc1, %g0;                /* Is our save area on one page? */ \
  86         bl,a    1b; \
  87         std     %l0, [%sp]; \
  88         add     %sp, 0x38, %g5;                 /* Nope, have to check both pages */ \
  89         sra     %g5, 0x1e, %g7; \
  90         subcc   %g7, 0x0, %g0; \
  91         be,a    4f; \
  92         andn    %g5, 0xfff, %g7; \
  93         subcc   %g7, -1, %g0; \
  94         bne     5f; \
  95         andn    %g5, 0xfff, %g7; \
  96 4:      lda     [%g7] ASI_PTE, %g7;             /* Stack space in 2nd page is valid */ \
  97         srl     %g7, 0x1d, %g7; \
  98         subcc   %g7, 0x6, %g0;                  /* Can user write here too? */ \
  99         be,a    1b; \
 100         std     %l0, [%sp]; \
 101 5:      ld      [%g6 + THREAD_UWINDOWS], %g7;   /* This is due to either bad page perms */ \
 102         add     %g6, THREAD_REG_WINDOW, %g5;    /* for the users stack area, or the stack */ \
 103 6:      std     %l0, [%g5];                     /* pointer is misaligned. See above. */ \
 104         std     %l2, [%g5 + 0x8]; \
 105         std     %l4, [%g5 + 0x10]; \
 106         std     %l6, [%g5 + 0x18]; \
 107         std     %i0, [%g5 + 0x20]; \
 108         std     %i2, [%g5 + 0x28]; \
 109         std     %i4, [%g5 + 0x30]; \
 110         std     %i6, [%g5 + 0x38]; \
 111         subcc   %g7, 0x1, %g7; \
 112         bge,a   6b;                             /* while(uwindows>=0) { write_win(); */ \
 113         save    %g5, 0x40, %g5;                 /*     uwindows--; } */ \
 114         st      %sp, [%g6 + THREAD_USP]; \
 115         or      %g0, 0x1, %g5; \
 116         rd      %psr, %g7; \
 117         sll     %g5, %g7, %g5; \
 118         wr      %g5, 0x0, %wim; \
 119         and     %g7, 0x1f, %g7; \
 120         st      %g7, [%g6 + THREAD_WIM];        /* Update thread_struct fields */ \
 121         ld      [%g6 + THREAD_UWINDOWS], %g7; \
 122         add     %g7, 0x1, %g5; \
 123         st      %g5, [%g6 + THREAD_W_SAVED]; \
 124         st      %g0, [%g6 + THREAD_UWINDOWS]; \
 125 7:      subcc   %g7, 0x1, %g7;                  /* Restore back to where we started. */ \
 126         bge     7b; \
 127         restore %g0, %g0, %g0; \
 128         or      %g0, %l5, %g5;                  /* Restore the globals. */ \
 129         or      %g0, %l6, %g6; \
 130         or      %g0, %l7, %g7; \
 131 8:      nop;                                     /* We are done when we get here. */ \
 132 
 133 /* As if the last macro wasn't enough, we have to go through a very similar routine
 134  * upon entry to most traps and interrupts. This is save away the current window
 135  * if it is the trap window, clean it, and adjust the stack for the handler c-code
 136  * to work.
 137  */
 138 
 139 #define ENTER_TRAP \
 140         rd      %wim, %l4; \
 141         or      %g0, 0x1, %l5; \
 142         sll     %l5, %l0, %l5; \
 143         andcc   %l0, 0x40, %g0; \
 144         bz      1f; \
 145         andcc   %l4, %l5, %g0; \
 146         bz,a    3f; \
 147         sub     %fp, 0xb0, %sp; \
 148         TRAP_WIN_CLEAN \
 149         b       3f; \
 150         sub     %fp, 0xb0, %sp; \
 151 1:      sethi   %hi( C_LABEL(current) ), %l6; \
 152         ld      [%l6 + %lo( C_LABEL(current) )], %l6; \
 153         ld      [%l6 + THREAD_WIM], %l5; \
 154         and     %l0, 0x1f, %l4; \
 155         cmp     %l5, %l3; \
 156         ble,a   4f; \
 157         sethi   %hi( C_LABEL(nwindowsm1) ), %l4; \
 158         sub     %l5, %l3, %l3; \
 159         b       5f; \
 160         sub     %l3, 0x1, %l5; \
 161 4:      ld      [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4; \
 162         sub     %l4, %l3, %l4; \
 163         add     %l5, %l4, %l5; \
 164 5:      st      %l5, [%l6 + THREAD_UWINDOWS]; \
 165         bz,a    2f; \
 166         sethi   %hi(TASK_SIZE-176), %l5; \
 167         TRAP_WIN_CLEAN; \
 168         sethi   %hi( C_LABEL(current) ), %l6; \
 169         ld      [%l6 + %lo( C_LABEL(current) )], %l6; \
 170         sethi   %hi(TASK_SIZE-176), %l5; \
 171 2:      or      %l5, %lo(TASK_SIZE-176), %l5; \
 172         add     %l6, %l5, %sp; \
 173 3: \
 174 
 175 #define ENTER_IRQ \
 176         rd      %wim, %l4; \
 177         or      %g0, 0x1, %l5; \
 178         sll     %l5, %l0, %l5; \
 179         andcc   %l0, 0x40, %g0; \
 180         bz      1f; \
 181         andcc   %l4, %l5, %g0; \
 182         bz,a    0f; \
 183         sethi   %hi( C_LABEL(eintstack) ), %l7; \
 184         TRAP_WIN_CLEAN \
 185         sethi   %hi( C_LABEL(eintstack) ), %l7; \
 186 0:      cmp     %fp, %l7; \
 187         bge,a   3f; \
 188         sub     %l7, 0xb0, %sp; \
 189         b       3f; \
 190         sub     %fp, 0xb0, %sp; \
 191 1:      sethi   %hi( C_LABEL(current) ), %l6; \
 192         ld      [%l6 + %lo( C_LABEL(current) )], %l6; \
 193         ld      [%l6 + THREAD_WIM], %l5; \
 194         and     %l0, 0x1f, %l7; \
 195         cmp     %l5, %l7; \
 196         ble,a   4f; \
 197         sethi   %hi( C_LABEL(nwindowsm1) ), %l4; \
 198         sub     %l5, %l7, %l7; \
 199         b       5f; \
 200         sub     %l7, 0x1, %l5; \
 201 4:      ld      [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4; \
 202         sub     %l4, %l7, %l4; \
 203         add     %l5, %l4, %l5; \
 204 5:      st      %l5, [%l6 + THREAD_UWINDOWS]; \
 205         bz,a    2f; \
 206         sethi   %hi( C_LABEL(eintstack) ), %l7; \
 207         TRAP_WIN_CLEAN; \
 208         sethi   %hi( C_LABEL(eintstack) ), %l7; \
 209 2: \
 210         sub     %l7, 0xb0, %sp; \
 211 3:
 212 
 213         .text
 214         .align 4
 215 
 216 /* Default trap handler */
 217         .globl my_trap_handler
 218 my_trap_handler:
 219 #if 1
 220                 jmp     %l1
 221                 rett    %l2
 222                 nop
 223 #else
 224                 rd %wim, %l4
 225                 or %g0, 0x1, %l5
 226                 sll %l5, %l0, %l5
 227                 cmp %l4, %l5        ! are we in the invalid window?
 228         
 229                 TRAP_WIN_CLEAN
 230 
 231                 nop
 232                 or %g0, %l3, %o0
 233                 call C_LABEL(do_hw_interrupt)
 234                 or %g0, %g0, %o1
 235                 wr %l0, 0x20, %psr  ! re-enable traps and reset the condition codes
 236                 nop
 237                 nop
 238                 nop                 ! click our heels three times, "no place like home"
 239                 jmp %l1
 240                 rett %l2
 241 #endif /* bogon */
 242         
 243         .globl sparc_timer
 244 sparc_timer:
 245         ENTER_IRQ
 246         or      %g0, 0x10, %o0  
 247         call    C_LABEL(do_IRQ)
 248         or      %g0, %g0, %o1
 249         jmp     %l1
 250         rett    %l2
 251         nop     
 252 
 253 /* This routine is optimized for kernel window fills. User fills take about two
 254  * or three extra jumps on the average. We'll see how this works out.
 255  */
 256 
 257 /* Don't use local labels, or if you do be REAL CAREFUL. TRAP_WIN_CLEAN is
 258  * full of them! If you think this routine is hairy, window spills are worse,
 259  * see below.
 260  */
 261 
 262         .align 4
 263         .globl spill_window_entry
 264 spill_window_entry:
 265         andcc   %l0, 0x40, %g0          ! see if this is a user window fill
 266         bz,a    spill_from_user
 267         nop
 268 
 269         TRAP_WIN_CLEAN                  /* danger, danger... */
 270         wr      %l0, 0x0, %psr  
 271         nop
 272         jmp     %l1
 273         rett    %l2
 274 
 275 spill_from_user:
 276         sethi   %hi( C_LABEL(current) ), %l6
 277         ld      [%l6 + %lo( C_LABEL(current) )], %l6
 278         ld      [%l6 + THREAD_WIM], %l5
 279         and     %l0, 0x1f, %l3
 280 
 281 /* I don't know what's worse, the extra comparison here, or an extra load
 282  * from a lookup table, we'll see.
 283  */
 284         cmp     %l5, %l3
 285         ble,a   1f
 286         sethi   %hi( C_LABEL(nwindowsm1) ), %l4
 287         sub     %l5, %l3, %l3
 288         b       2f
 289         sub     %l3, 0x1, %l5
 290 1:      ld      [%l4 + %lo( C_LABEL(nwindowsm1) )], %l4
 291         sub     %l4, %l3, %l4
 292         add     %l5, %l4, %l5
 293 2:      st      %l5, [%l6 + THREAD_UWINDOWS]
 294 
 295         TRAP_WIN_CLEAN             /* danger, danger... */
 296         sethi   %hi( C_LABEL(current) ), %l6
 297         ld      [%l6 + %lo( C_LABEL(current) )], %l6
 298         ld      [%l6 + THREAD_KSP], %sp
 299         and     %l0, 0x1f, %l3
 300         sethi   %hi(lnx_winmask), %l6
 301         or      %l6, %lo(lnx_winmask), %l6
 302         ldub    [%l6 + %l3], %l5
 303         rd      %wim, %l4
 304         jmp     %l1
 305         rett    %l2
 306 
 307 /* A window spill has occurred.  This presents a weird situation, a restore
 308  * was attempted and a trap occurred. Therefore the restore attempt had no
 309  * effect on window movement and the trap saved, which means it went in the
 310  * other direction. :-( We are in a trap window which is two restores away
 311  * from the window we want to un-invalidate so to speak and three away from
 312  * the one which will become invalid after this routine. There are probably
 313  * bugs already this routine. Bugs suck.
 314  */
 315 
 316 /* This is a very complicated and hairy routine, don't expect to understand
 317  * it the first time. :>
 318  */
 319 
 320         .align 4
 321         .globl fill_window_entry
 322 fill_window_entry:
 323         wr      %g0, 0, %wim            ! Can not enter invalid register without this.
 324         andcc   %l0, 0x40, %g0          ! From user?
 325         restore                         ! restore to where trap occurred
 326         bz      fill_from_user
 327         restore                         ! enter invalid register, whee...
 328         restore %g0, 0x1, %l1           ! enter one-past invalid register
 329         rd      %psr, %l0               ! this is the window we need to save
 330         and     %l0, 0x1f, %l0
 331         sll     %l1, %l0, %l1
 332         wr      %l1, 0x0, %wim
 333         sethi   %hi( C_LABEL(current) ), %l1
 334         ld      [%l1 + %lo( C_LABEL(current) )], %l1
 335         st      %l0, [%l1 + THREAD_WIM]
 336         save    %g0, %g0, %g0           ! back to invalid register
 337         ldd     [%sp], %l0              ! load the window from stack
 338         ldd     [%sp + 8], %l2
 339         ldd     [%sp + 16], %l4
 340         ldd     [%sp + 24], %l6
 341         ldd     [%sp + 32], %i0
 342         ldd     [%sp + 40], %i2
 343         ldd     [%sp + 48], %i4
 344         ldd     [%sp + 56], %i6
 345         save    %g0, %g0, %g0           ! to window where trap happened
 346         save    %g0, %g0, %g0           ! back to trap window, so rett works
 347         wr      %l0, 0x0, %psr          ! load condition codes
 348         nop
 349         jmp     %l1
 350         rett    %l2                     ! are you as confused as I am?
 351 
 352 fill_from_user:
 353         andcc   %sp, 0x7, %g0           ! check for alignment of user stack
 354         bne     fill_bad_stack
 355         sra     %sp, 0x1e, %l7
 356         cmp     %l7, 0x0
 357         be,a    1f
 358         andn    %sp, 0xfff, %l7
 359         cmp     %l7, -1
 360         bne     fill_bad_stack
 361         andn    %sp, 0xfff, %l7
 362 1:      lda     [%l7] ASI_PTE, %l7
 363         srl     %l7, 0x1d, %l7
 364         andn    %l7, 0x2, %l7
 365         cmp     %l7, 0x4
 366         bne     fill_bad_stack
 367         and     %sp, 0xfff, %l7
 368         cmp     %l7, 0xfc1
 369         bl,a    fill_stack_ok
 370         restore %g0, 1, %l1
 371         add     %sp, 0x38, %l5
 372         sra     %sp, 0x1e, %l7
 373         cmp     %l7, 0x0
 374         be,a    1f
 375         andn    %sp, 0xfff, %l7
 376         cmp     %l7, -1
 377         bne     fill_bad_stack
 378         andn    %sp, 0xfff, %l7
 379 1:      lda     [%l7] ASI_PTE, %l7
 380         srl     %l7, 0x1d, %l7
 381         andn    %l7, 0x2, %l7
 382         cmp     %l7, 0x4
 383         be,a    fill_stack_ok
 384         restore %g0, 0x1, %l1
 385 
 386 fill_bad_stack:
 387         save    %g0, %g0, %g0                   ! save to where restore happened
 388         save    %g0, 0x1, %l4                   ! save is an add remember? to trap window
 389         sethi   %hi( C_LABEL(current) ), %l6
 390         ld      [%l6 + %lo( C_LABEL(current) )], %l6
 391         st      %l4, [%l6 + THREAD_UWINDOWS]    ! update current->tss values
 392         ld      [%l6 + THREAD_WIM], %l5
 393         sll     %l4, %l5, %l4
 394         wr      %l4, 0x0, %wim
 395         ld      [%l6 + THREAD_KSP], %sp         ! set to kernel stack pointer
 396         wr      %l0, 0x20, %psr                 ! turn off traps
 397         std     %l0, [%sp + C_STACK]            ! set up thread_frame on stack
 398         rd      %y, %l3
 399         std     %l2, [%sp + C_STACK + 0x8]
 400         or      %g0, 0x6, %o0                   ! so _sparc_trap knows what to do
 401         st      %g1, [%sp + C_STACK + 0x14]     ! no need to save %g0, always zero
 402         or      %g0, %l0, %o1
 403         std     %g2, [%sp + C_STACK + 0x18]
 404         or      %g0, %l1, %o2
 405         std     %g4, [%sp + C_STACK + 0x20]
 406         add     %sp, C_STACK, %o3
 407         std     %g6, [%sp + C_STACK + 0x28]
 408         std     %i0, [%sp + C_STACK + 0x30]
 409         std     %i2, [%sp + C_STACK + 0x38]
 410         std     %i4, [%sp + C_STACK + 0x40]
 411         call    sparc_trap
 412         std     %i6, [%sp + C_STACK + 0x48]
 413         
 414         ldd     [%sp + C_STACK], %l0
 415         ldd     [%sp + C_STACK + 0x8], %l2
 416         wr      %l3, 0, %y
 417         ld      [%sp + C_STACK + 0x14], %g1
 418         ldd     [%sp + C_STACK + 0x18], %g2
 419         ldd     [%sp + C_STACK + 0x20], %g4
 420         ldd     [%sp + C_STACK + 0x28], %g6
 421         ldd     [%sp + C_STACK + 0x30], %i0
 422         ldd     [%sp + C_STACK + 0x38], %i2
 423         ldd     [%sp + C_STACK + 0x40], %i4
 424         wr      %l0, 0, %psr                    ! disable traps again
 425         ldd     [%sp + C_STACK + 0x48], %i6
 426         sethi   %hi( C_LABEL(current) ), %l6
 427         ld      [%l6 + %lo( C_LABEL(current) )], %l6
 428         ld      [%l6 + THREAD_W_SAVED], %l7
 429         cmp     %l7, 0x0
 430         bl,a    1f
 431         wr      %g0, 0x0, %wim
 432         b,a     leave_trap
 433 
 434 1:      or      %g0, %g6, %l3
 435         or      %g0, %l6, %g6
 436         st      %g0, [%g6 + THREAD_W_SAVED]
 437         restore %g0, %g0, %g0
 438         restore %g0, %g0, %g0
 439         restore %g0, 0x1, %l1
 440         rd      %psr, %l0
 441         sll     %l1, %l0, %l1
 442         wr      %l1, 0x0, %wim
 443         and     %l0, 0x1f, %l0
 444         st      %l0, [%g6 + THREAD_WIM]
 445         nop
 446         save    %g0, %g0, %g0
 447         ldd     [%sp], %l0                      ! load number one
 448         ldd     [%sp + 0x8], %l2
 449         ldd     [%sp + 0x10], %l4
 450         ldd     [%sp + 0x18], %l6
 451         ldd     [%sp + 0x20], %i0
 452         ldd     [%sp + 0x28], %i2
 453         ldd     [%sp + 0x30], %i4
 454         ldd     [%sp + 0x38], %i6
 455         save    %g0, %g0, %g0
 456         ldd     [%sp], %l0                      ! load number two
 457         ldd     [%sp + 0x8], %l2        
 458         ldd     [%sp + 0x10], %l4
 459         ldd     [%sp + 0x18], %l6
 460         ldd     [%sp + 0x20], %i0
 461         ldd     [%sp + 0x28], %i2
 462         ldd     [%sp + 0x30], %i4
 463         ldd     [%sp + 0x38], %i6
 464         save    %g0, %g0, %g0                   ! re-enter trap window
 465         wr      %l0, 0x0, %psr                  ! restore condition codes
 466         or      %g0, %l3, %g6                   ! restore scratch register
 467         jmp     %l1
 468         rett    %l2
 469 
 470 fill_stack_ok:
 471         rd      %psr, %l0
 472         sll     %l1, %l0, %l1
 473         wr      %l1, 0x0, %wim
 474         sethi   %hi( C_LABEL(current) ), %l2
 475         ld      [%l2 + %lo( C_LABEL(current) )], %l2
 476         and     %l0, 0x1f, %l0
 477         st      %l0, [%l2 + THREAD_WIM]
 478         save    %g0, %g0, %g0
 479         ldd     [%sp], %l0                      ! only one load necessary
 480         ldd     [%sp + 0x8], %l2
 481         ldd     [%sp + 0x10], %l4
 482         ldd     [%sp + 0x18], %l6
 483         ldd     [%sp + 0x20], %i0
 484         ldd     [%sp + 0x28], %i2
 485         ldd     [%sp + 0x30], %i4
 486         ldd     [%sp + 0x38], %i6
 487         save    %g0, %g0, %g0
 488         save    %g0, %g0, %g0                   ! save into trap window
 489         wr      %l0, 0x0, %psr                  ! local number 0 here has cond codes
 490         nop
 491         jmp     %l1
 492         rett    %l2
 493 
 494         .align 4
 495         .globl trap_entry
 496 trap_entry:
 497         TRAP_WIN_CLEAN
 498         jmp     %l1
 499         rett    %l2
 500 
 501         .align 4
 502         .globl linux_trap_nmi
 503 linux_trap_nmi:
 504         TRAP_WIN_CLEAN
 505         jmp     %l1
 506         rett    %l2
 507 
 508         .align 4
 509         .globl sparc_trap
 510 sparc_trap:
 511         TRAP_WIN_CLEAN
 512         jmp     %l1
 513         rett    %l2
 514 
 515         .align 4
 516         .globl leave_trap
 517 leave_trap:
 518         jmp     %l1
 519         rett    %l2
 520 
 521 /* The following two things point to window management tables. The first
 522    one is used to quickly look up how many user windows there are from
 523    trap-land. The second is used in a trap handler to determine if a rett
 524    instruction will land us smack inside the invalid window that possibly
 525    the trap was called to fix-up.
 526 */
 527 
 528 /* For now these are static tables geared for a 7 window sparc. */
 529 
 530                 .data
 531                 .align 4
 532 lnx_winmask:    .byte   2, 4, 8, 16, 32, 64, 128,1  ! lnx_winmask[0..7]
 533 
 534         
 535                 .align 4
 536                 .globl C_LABEL(sys_call_table)
 537 C_LABEL(sys_call_table):
 538         .long C_LABEL(sys_setup)                /* 0 */
 539         .long C_LABEL(sys_exit)
 540         .long C_LABEL(sys_fork)
 541         .long C_LABEL(sys_read)
 542         .long C_LABEL(sys_write)
 543         .long C_LABEL(sys_open)                 /* 5 */
 544         .long C_LABEL(sys_close)
 545         .long C_LABEL(sys_waitpid)
 546         .long C_LABEL(sys_creat)
 547         .long C_LABEL(sys_link)
 548         .long C_LABEL(sys_unlink)               /* 10 */
 549         .long C_LABEL(sys_execve)
 550         .long C_LABEL(sys_chdir)
 551         .long C_LABEL(sys_time)
 552         .long C_LABEL(sys_mknod)
 553         .long C_LABEL(sys_chmod)                /* 15 */
 554         .long C_LABEL(sys_chown)
 555         .long C_LABEL(sys_break)
 556         .long C_LABEL(sys_stat)
 557         .long C_LABEL(sys_lseek)
 558         .long C_LABEL(sys_getpid)               /* 20 */
 559         .long C_LABEL(sys_mount)
 560         .long C_LABEL(sys_umount)
 561         .long C_LABEL(sys_setuid)
 562         .long C_LABEL(sys_getuid)
 563         .long C_LABEL(sys_stime)                /* 25 */
 564         .long C_LABEL(sys_ni_syscall)           /* this will be sys_ptrace() */
 565         .long C_LABEL(sys_alarm)
 566         .long C_LABEL(sys_fstat)
 567         .long C_LABEL(sys_pause)
 568         .long C_LABEL(sys_utime)                /* 30 */
 569         .long C_LABEL(sys_stty)
 570         .long C_LABEL(sys_gtty)
 571         .long C_LABEL(sys_access)
 572         .long C_LABEL(sys_nice)
 573         .long C_LABEL(sys_ftime)                /* 35 */
 574         .long C_LABEL(sys_sync)
 575         .long C_LABEL(sys_kill)
 576         .long C_LABEL(sys_rename)
 577         .long C_LABEL(sys_mkdir)
 578         .long C_LABEL(sys_rmdir)                /* 40 */
 579         .long C_LABEL(sys_dup)
 580         .long C_LABEL(sys_pipe)
 581         .long C_LABEL(sys_times)
 582         .long C_LABEL(sys_prof)
 583         .long C_LABEL(sys_brk)                  /* 45 */
 584         .long C_LABEL(sys_setgid)
 585         .long C_LABEL(sys_getgid)
 586         .long C_LABEL(sys_signal)
 587         .long C_LABEL(sys_geteuid)
 588         .long C_LABEL(sys_getegid)              /* 50 */
 589         .long C_LABEL(sys_acct)
 590         .long C_LABEL(sys_phys)
 591         .long C_LABEL(sys_lock)
 592         .long C_LABEL(sys_ioctl)
 593         .long C_LABEL(sys_fcntl)                /* 55 */
 594         .long C_LABEL(sys_mpx)
 595         .long C_LABEL(sys_setpgid)
 596         .long C_LABEL(sys_ulimit)
 597         .long C_LABEL(sys_olduname)
 598         .long C_LABEL(sys_umask)        /* 60 */
 599         .long C_LABEL(sys_chroot)
 600         .long C_LABEL(sys_ustat)
 601         .long C_LABEL(sys_dup2)
 602         .long C_LABEL(sys_getppid)
 603         .long C_LABEL(sys_getpgrp)              /* 65 */
 604         .long C_LABEL(sys_setsid)
 605         .long C_LABEL(sys_sigaction)
 606         .long C_LABEL(sys_sgetmask)
 607         .long C_LABEL(sys_ssetmask)
 608         .long C_LABEL(sys_setreuid)             /* 70 */
 609         .long C_LABEL(sys_setregid)
 610         .long C_LABEL(sys_sigsuspend)
 611         .long C_LABEL(sys_sigpending)
 612         .long C_LABEL(sys_sethostname)
 613         .long C_LABEL(sys_setrlimit)            /* 75 */
 614         .long C_LABEL(sys_getrlimit)
 615         .long C_LABEL(sys_getrusage)
 616         .long C_LABEL(sys_gettimeofday)
 617         .long C_LABEL(sys_settimeofday)
 618         .long C_LABEL(sys_getgroups)            /* 80 */
 619         .long C_LABEL(sys_setgroups)
 620         .long C_LABEL(sys_select)
 621         .long C_LABEL(sys_symlink)
 622         .long C_LABEL(sys_lstat)
 623         .long C_LABEL(sys_readlink)             /* 85 */
 624         .long C_LABEL(sys_uselib)
 625         .long C_LABEL(sys_swapon)
 626         .long C_LABEL(sys_reboot)
 627         .long C_LABEL(sys_readdir)
 628         .long C_LABEL(sys_mmap)                 /* 90 */
 629         .long C_LABEL(sys_munmap)
 630         .long C_LABEL(sys_truncate)
 631         .long C_LABEL(sys_ftruncate)
 632         .long C_LABEL(sys_fchmod)
 633         .long C_LABEL(sys_fchown)               /* 95 */
 634         .long C_LABEL(sys_getpriority)
 635         .long C_LABEL(sys_setpriority)
 636         .long C_LABEL(sys_profil)
 637         .long C_LABEL(sys_statfs)
 638         .long C_LABEL(sys_fstatfs)              /* 100 */
 639         .long C_LABEL(sys_ni_syscall)
 640         .long C_LABEL(sys_socketcall)
 641         .long C_LABEL(sys_syslog)
 642         .long C_LABEL(sys_setitimer)
 643         .long C_LABEL(sys_getitimer)            /* 105 */
 644         .long C_LABEL(sys_newstat)
 645         .long C_LABEL(sys_newlstat)
 646         .long C_LABEL(sys_newfstat)
 647         .long C_LABEL(sys_uname)
 648         .long C_LABEL(sys_ni_syscall)           /* 110 */
 649         .long C_LABEL(sys_vhangup)
 650         .long C_LABEL(sys_idle)
 651         .long C_LABEL(sys_ni_syscall)           /* was vm86, meaningless on Sparc */
 652         .long C_LABEL(sys_wait4)
 653         .long C_LABEL(sys_swapoff)              /* 115 */
 654         .long C_LABEL(sys_sysinfo)
 655         .long C_LABEL(sys_ipc)
 656         .long C_LABEL(sys_fsync)
 657         .long C_LABEL(sys_sigreturn)
 658         .long C_LABEL(sys_ni_syscall)           /* 120 */
 659         .long C_LABEL(sys_setdomainname)
 660         .long C_LABEL(sys_newuname)
 661         .long C_LABEL(sys_ni_syscall)
 662         .long C_LABEL(sys_adjtimex)
 663         .long C_LABEL(sys_mprotect)             /* 125 */
 664         .long C_LABEL(sys_sigprocmask)
 665         .long C_LABEL(sys_create_module)
 666         .long C_LABEL(sys_init_module)
 667         .long C_LABEL(sys_delete_module)
 668         .long C_LABEL(sys_get_kernel_syms)      /* 130 */
 669         .long C_LABEL(sys_ni_syscall)
 670         .long C_LABEL(sys_getpgid)
 671         .long C_LABEL(sys_fchdir)
 672         .long C_LABEL(sys_bdflush)
 673         .long C_LABEL(sys_sysfs)        /* 135 */
 674         .long C_LABEL(sys_personality)
 675         .long 0                         /* for afs_syscall */
 676         .long C_LABEL(sys_setfsuid)
 677         .long C_LABEL(sys_setfsgid)
 678         .long C_LABEL(sys_llseek)               /* 140 */
 679         .align 4

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