Ignore:
Timestamp:
2006-09-03T23:37:14Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd85ae5
Parents:
002e613
Message:

sparc64 update.

  • Prototype userspace layer implementation that at least relates to sparc64 and compiles cleanly.
  • Fixes for kernel's preemptible_handler and code related to running userspace.
  • Enable userspace. Several dozen instructions are now run in userspace! We are pretty near the userspace milestone for sparc64.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/libc/arch/sparc64/src/psthread.S

    r002e613 rcfa70add  
    11#
    2 # Copyright (C) 2006 Martin Decky
     2# Copyright (C) 2005 Jakub Jermar
    33# All rights reserved.
    44#
     
    2727#
    2828
    29 .text
     29#include <libarch/context_offset.h>
     30
     31/**
     32 * Both context_save_arch() and context_restore_arch() are
     33 * leaf-optimized procedures. This kind of optimization
     34 * is very important and prevents any implicit window
     35 * spill/fill/clean traps in these very core kernel
     36 * functions.
     37 */
     38       
     39.text   
    3040
    3141.global context_save
    3242.global context_restore
    3343
    34 #include <libarch/context_offset.h>
     44.macro CONTEXT_STORE r
     45        stx %sp, [\r + OFFSET_SP]
     46        stx %o7, [\r + OFFSET_PC]
     47        stx %i0, [\r + OFFSET_I0]
     48        stx %i1, [\r + OFFSET_I1]
     49        stx %i2, [\r + OFFSET_I2]
     50        stx %i3, [\r + OFFSET_I3]
     51        stx %i4, [\r + OFFSET_I4]
     52        stx %i5, [\r + OFFSET_I5]
     53        stx %fp, [\r + OFFSET_FP]
     54        stx %i7, [\r + OFFSET_I7]
     55        stx %l0, [\r + OFFSET_L0]
     56        stx %l1, [\r + OFFSET_L1]
     57        stx %l2, [\r + OFFSET_L2]
     58        stx %l3, [\r + OFFSET_L3]
     59        stx %l4, [\r + OFFSET_L4]
     60        stx %l5, [\r + OFFSET_L5]
     61        stx %l6, [\r + OFFSET_L6]
     62        stx %l7, [\r + OFFSET_L7]
     63        stx %g7, [\r + OFFSET_TP]
     64.endm
     65
     66.macro CONTEXT_LOAD r
     67        ldx [\r + OFFSET_SP], %sp
     68        ldx [\r + OFFSET_PC], %o7
     69        ldx [\r + OFFSET_I0], %i0
     70        ldx [\r + OFFSET_I1], %i1
     71        ldx [\r + OFFSET_I2], %i2
     72        ldx [\r + OFFSET_I3], %i3
     73        ldx [\r + OFFSET_I4], %i4
     74        ldx [\r + OFFSET_I5], %i5
     75        ldx [\r + OFFSET_FP], %fp
     76        ldx [\r + OFFSET_I7], %i7
     77        ldx [\r + OFFSET_L0], %l0
     78        ldx [\r + OFFSET_L1], %l1
     79        ldx [\r + OFFSET_L2], %l2
     80        ldx [\r + OFFSET_L3], %l3
     81        ldx [\r + OFFSET_L4], %l4
     82        ldx [\r + OFFSET_L5], %l5
     83        ldx [\r + OFFSET_L6], %l6
     84        ldx [\r + OFFSET_L7], %l7
     85        ldx [\r + OFFSET_TP], %g7
     86.endm
    3587
    3688context_save:
    37 
     89        CONTEXT_STORE %o0
     90        retl
     91        mov 1, %o0              ! context_save_arch returns 1
    3892
    3993context_restore:
     94        #
     95        # Flush all active windows.
     96        # This is essential, because CONTEXT_LOAD overwrites
     97        # %sp of CWP - 1 with the value written to %fp of CWP.
     98        # Flushing all active windows mitigates this problem
     99        # as CWP - 1 becomes the overlap window.
     100        #               
     101        flushw
     102       
     103        CONTEXT_LOAD %o0
     104        retl
     105        xor %o0, %o0, %o0       ! context_restore_arch returns 0
Note: See TracChangeset for help on using the changeset viewer.