Changeset 32573ff in mainline for kernel


Ignore:
Timestamp:
2016-05-02T20:58:16Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c4b26c
Parents:
6adb775f (diff), 5035ba05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline, which has dltest and fixes.

Location:
kernel
Files:
7 added
67 edited
4 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/src/abs32le.c

    r6adb775f r32573ff  
    8585}
    8686
    87 sysarg_t sys_tls_set(uintptr_t addr)
    88 {
    89         return EOK;
    90 }
    91 
    9287/** Construct function pointer
    9388 *
  • kernel/arch/amd64/Makefile.inc

    r6adb775f r32573ff  
    5757        arch/$(KARCH)/src/debug/stacktrace_asm.S \
    5858        arch/$(KARCH)/src/pm.c \
     59        arch/$(KARCH)/src/vreg.c \
     60        arch/$(KARCH)/src/kseg.c \
    5961        arch/$(KARCH)/src/context.S \
    6062        arch/$(KARCH)/src/ddi/ddi.c \
     
    9092ARCH_AUTOGENS_AG = \
    9193        arch/$(KARCH)/include/arch/istate_struct.ag \
    92         arch/$(KARCH)/include/arch/context_struct.ag
     94        arch/$(KARCH)/include/arch/context_struct.ag \
     95        arch/$(KARCH)/include/arch/kseg_struct.ag
  • kernel/arch/amd64/include/arch/asm.h

    r6adb775f r32573ff  
    206206        } else
    207207                *port = val;
    208 }
    209 
    210 /** Swap Hidden part of GS register with visible one */
    211 NO_TRACE static inline void swapgs(void)
    212 {
    213         asm volatile (
    214                 "swapgs"
    215         );
    216208}
    217209
  • kernel/arch/amd64/include/arch/context_struct.ag

    r6adb775f r32573ff  
    7575                        type : uint64_t
    7676                },
     77                {
     78                        name : tp,
     79                        type : uint64_t
     80                },
    7781
    7882                {
  • kernel/arch/amd64/include/arch/cpu.h

    r6adb775f r32573ff  
    5656
    5757/* MSR registers */
    58 #define AMD_MSR_STAR    0xc0000081
    59 #define AMD_MSR_LSTAR   0xc0000082
    60 #define AMD_MSR_SFMASK  0xc0000084
    61 #define AMD_MSR_FS      0xc0000100
    62 #define AMD_MSR_GS      0xc0000101
     58#define AMD_MSR_STAR            0xc0000081
     59#define AMD_MSR_LSTAR           0xc0000082
     60#define AMD_MSR_SFMASK          0xc0000084
     61#define AMD_MSR_FS              0xc0000100
     62#define AMD_MSR_GS              0xc0000101
     63#define AMD_MSR_GS_KERNEL       0xc0000102
    6364
    6465#ifndef __ASM__
  • kernel/arch/amd64/include/arch/proc/thread.h

    r6adb775f r32573ff  
    3636#define KERN_amd64_THREAD_H_
    3737
    38 /* CAUTION: keep these in sync with low level assembly code in syscall_entry */
    39 #define SYSCALL_USTACK_RSP  0
    40 #define SYSCALL_KSTACK_RSP  1
     38#include <typedefs.h>
    4139
    4240typedef struct {
    43         sysarg_t tls;
    44         /** User and kernel RSP for syscalls. */
    45         uint64_t syscall_rsp[2];
     41        uint64_t kstack_rsp;
    4642} thread_arch_t;
    4743
  • kernel/arch/amd64/src/amd64.c

    r6adb775f r32573ff  
    5656#include <genarch/multiboot/multiboot.h>
    5757#include <genarch/multiboot/multiboot2.h>
     58#include <arch/pm.h>
     59#include <arch/vreg.h>
     60#include <arch/kseg.h>
    5861
    5962#ifdef CONFIG_SMP
     
    139142void arch_post_mm_init(void)
    140143{
     144        vreg_init();
     145        kseg_init();
     146
    141147        if (config.cpu_active == 1) {
    142148                /* Initialize IRQ routing */
     
    262268}
    263269
    264 /** Set thread-local-storage pointer
    265  *
    266  * TLS pointer is set in FS register. Unfortunately the 64-bit
    267  * part can be set only in CPL0 mode.
    268  *
    269  * The specs say, that on %fs:0 there is stored contents of %fs register,
    270  * we need not to go to CPL0 to read it.
    271  */
    272 sysarg_t sys_tls_set(uintptr_t addr)
    273 {
    274         THREAD->arch.tls = addr;
    275         write_msr(AMD_MSR_FS, addr);
    276        
    277         return EOK;
    278 }
    279 
    280270/** Construct function pointer
    281271 *
  • kernel/arch/amd64/src/asm.S

    r6adb775f r32573ff  
    3131#include <arch/mm/page.h>
    3232#include <arch/istate_struct.h>
     33#include <arch/kseg_struct.h>
     34#include <arch/cpu.h>
    3335
    3436.text
     
    178180                subq $(ISTATE_SOFT_SIZE + 8), %rsp
    179181        .endif
    180        
     182
    181183        /*
    182184         * Save the general purpose registers.
     
    199201
    200202        /*
     203         * Is this trap from the kernel?
     204         */
     205        cmpq $(GDT_SELECTOR(KTEXT_DES)), ISTATE_OFFSET_CS(%rsp)
     206        jz 0f
     207
     208        /*
     209         * Switch to kernel FS base.
     210         */
     211        swapgs
     212        movl $AMD_MSR_FS, %ecx
     213        movl %gs:KSEG_OFFSET_FSBASE, %eax
     214        movl %gs:KSEG_OFFSET_FSBASE+4, %edx
     215        wrmsr
     216        swapgs
     217
     218        /*
    201219         * Imitate a regular stack frame linkage.
    202220         * Stop stack traces here if we came from userspace.
    203221         */
    204         xorl %edx, %edx
    205         cmpq $(GDT_SELECTOR(KTEXT_DES)), ISTATE_OFFSET_CS(%rsp)
     2220:      movl $0x0, %edx
    206223        cmovnzq %rdx, %rbp
    207224
     
    272289        swapgs
    273290       
    274         /*
    275          * %gs:0 Scratch space for this thread's user RSP
    276          * %gs:8 Address to be used as this thread's kernel RSP
    277          */
    278        
    279         movq %rsp, %gs:0  /* save this thread's user RSP */
    280         movq %gs:8, %rsp  /* set this thread's kernel RSP */
    281        
     291        movq %rsp, %gs:KSEG_OFFSET_USTACK_RSP  /* save this thread's user RSP */
     292        movq %gs:KSEG_OFFSET_KSTACK_RSP, %rsp  /* set this thread's kernel RSP */
     293
    282294        /*
    283295         * Note that the space needed for the imitated istate structure has been
     
    308320
    309321        /*
     322         * Switch to kernel FS base.
     323         */
     324        movl $AMD_MSR_FS, %ecx
     325        movl %gs:KSEG_OFFSET_FSBASE, %eax
     326        movl %gs:KSEG_OFFSET_FSBASE+4, %edx
     327        wrmsr
     328        movq ISTATE_OFFSET_RDX(%rsp), %rdx      /* restore 3rd argument */
     329
     330        /*
    310331         * Save the return address and the userspace stack on locations that
    311332         * would normally be taken by them.
    312333         */
    313         movq %gs:0, %rax
     334        movq %gs:KSEG_OFFSET_USTACK_RSP, %rax
    314335        movq %rax, ISTATE_OFFSET_RSP(%rsp)
    315336        movq %rcx, ISTATE_OFFSET_RIP(%rsp)
     
    325346        swapgs
    326347        sti
    327        
     348
    328349        /* Copy the 4th argument where it is expected  */
    329350        movq %r10, %rcx
  • kernel/arch/amd64/src/context.S

    r6adb775f r32573ff  
    2929#include <abi/asmtool.h>
    3030#include <arch/context_struct.h>
     31#include <arch/vreg.h>
    3132
    3233.text
     
    5051        movq %r14, CONTEXT_OFFSET_R14(%rdi)
    5152        movq %r15, CONTEXT_OFFSET_R15(%rdi)
     53
     54        movq vreg_ptr, %rsi
     55        movq %fs:VREG_TP(%rsi), %rsi
     56        movq %rsi, CONTEXT_OFFSET_TP(%rdi)
    5257       
    5358        xorl %eax, %eax       # context_save returns 1
     
    7277        movq CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
    7378       
    74         movq CONTEXT_OFFSET_PC(%rdi), %rdx
    75        
     79        movq CONTEXT_OFFSET_PC(%rdi), %rdx
    7680        movq %rdx, (%rsp)
     81
     82        movq CONTEXT_OFFSET_TP(%rdi), %rcx
     83        movq vreg_ptr, %rsi
     84        movq %rcx, %fs:VREG_TP(%rsi)
    7785       
    7886        xorl %eax, %eax       # context_restore returns 0
  • kernel/arch/amd64/src/proc/scheduler.c

    r6adb775f r32573ff  
    4242#include <arch/pm.h>
    4343#include <arch/ddi/ddi.h>
     44#include <arch/kseg_struct.h>
    4445
    4546/** Perform amd64 specific tasks needed before the new task is run.
     
    5556void before_thread_runs_arch(void)
    5657{
    57         CPU->arch.tss->rsp0 =
    58             (uintptr_t) &THREAD->kstack[STACK_SIZE];
    59        
    60         /*
    61          * Syscall support.
    62          */
    63         swapgs();
    64         write_msr(AMD_MSR_GS, (uintptr_t) THREAD->arch.syscall_rsp);
    65         swapgs();
    66        
    67         /* TLS support - set FS to thread local storage */
    68         write_msr(AMD_MSR_FS, THREAD->arch.tls);
     58        CPU->arch.tss->rsp0 = (uintptr_t) &THREAD->kstack[STACK_SIZE];
     59
     60        kseg_t *kseg = (kseg_t *) read_msr(AMD_MSR_GS_KERNEL); 
     61        kseg->kstack_rsp = THREAD->arch.kstack_rsp;
    6962}
    7063
  • kernel/arch/amd64/src/proc/thread.c

    r6adb775f r32573ff  
    3535#include <proc/thread.h>
    3636#include <arch/interrupt.h>
     37#include <arch/kseg_struct.h>
    3738
    3839/** Perform amd64 specific thread initialization.
     
    4344void thread_create_arch(thread_t *thread)
    4445{
    45         thread->arch.tls = 0;
    46         thread->arch.syscall_rsp[SYSCALL_USTACK_RSP] = 0;
    47        
    4846        /*
    4947         * Kernel RSP can be precalculated at thread creation time.
    5048         */
    51         thread->arch.syscall_rsp[SYSCALL_KSTACK_RSP] =
     49        thread->arch.kstack_rsp =
    5250            (uintptr_t) &thread->kstack[PAGE_SIZE - sizeof(istate_t)];
    5351}
  • kernel/arch/arm32/Makefile.inc

    r6adb775f r32573ff  
    3333ATSIGN = %
    3434
    35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access
     35GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
    3636
    3737ifeq ($(CONFIG_FPU),y)
     
    7070ifeq ($(CONFIG_FPU),y)
    7171        ARCH_SOURCES += arch/$(KARCH)/src/fpu_context.c
    72         ARCH_SOURCES += arch/$(KARCH)/src/fpu.s
     72        ARCH_SOURCES += arch/$(KARCH)/src/fpu.S
    7373endif
    7474
  • kernel/arch/arm32/src/asm.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global memcpy_from_uspace
    32 .global memcpy_to_uspace
    33 .global memcpy_from_uspace_failover_address
    34 .global memcpy_to_uspace_failover_address
    35 .global early_putchar
    36 
    37 memcpy_from_uspace:
    38 memcpy_to_uspace:
     33FUNCTION_BEGIN(memcpy_from_uspace)
     34FUNCTION_BEGIN(memcpy_to_uspace)
    3935        add r3, r1, #3
    4036        bic r3, r3, #3
     
    9490                bne 7b
    9591                b 3b
     92FUNCTION_END(memcpy_from_uspace)
     93FUNCTION_END(memcpy_to_uspace)
    9694
    97 memcpy_from_uspace_failover_address:
    98 memcpy_to_uspace_failover_address:
     95SYMBOL(memcpy_from_uspace_failover_address)
     96SYMBOL(memcpy_to_uspace_failover_address)
    9997        mov r0, #0
    10098        ldmia sp!, {r4, r5, pc}
    10199
    102 early_putchar:
     100FUNCTION_BEGIN(early_putchar)
    103101        mov pc, lr
     102FUNCTION_END(early_putchar)
     103
  • kernel/arch/arm32/src/context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text   
    3032
    31 .global context_save_arch
    32 .global context_restore_arch
    33 
    34 context_save_arch:
     33FUNCTION_BEGIN(context_save_arch)
    3534        stmfd sp!, {r1}
    3635        mrs r1, cpsr
     
    4443        mov r0, #1
    4544        mov pc, lr
     45FUNCTION_END(context_save_arch)
    4646
    47 
    48 context_restore_arch:
     47FUNCTION_BEGIN(context_restore_arch)
    4948        ldmia r0!, {r4}
    5049        mrs r5, cpsr
     
    5857        mov r0, #0
    5958        mov pc, lr
     59FUNCTION_END(context_restore_arch)
     60
  • kernel/arch/arm32/src/debug/stacktrace_asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global frame_pointer_get
    32 .global program_counter_get
    33 
    34 frame_pointer_get:
     33FUNCTION_BEGIN(frame_pointer_get)
    3534        mov r0, fp
    3635        mov pc, lr
     36FUNCTION_END(frame_pointer_get)
    3737
    38 program_counter_get:
     38FUNCTION_BEGIN(program_counter_get)
    3939        mov r0, lr
    4040        mov pc, lr
     41FUNCTION_END(program_counter_get)
     42
  • kernel/arch/arm32/src/dummy.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global calibrate_delay_loop
    32 .global asm_delay_loop
     33FUNCTION_BEGIN(calibrate_delay_loop)
     34        mov     pc, lr
     35FUNCTION_END(calibrate_delay_loop)
    3336
    34 .global sys_tls_set
    35 .global dummy
    36 
    37 calibrate_delay_loop:
     37FUNCTION_BEGIN(asm_delay_loop)
    3838        mov     pc, lr
    39 
    40 asm_delay_loop:
    41         mov     pc, lr
    42 
    43 # not used on ARM
    44 sys_tls_set:
    45 
    46 dummy:
    47         mov pc, lr
     39FUNCTION_END(asm_delay_loop)
  • kernel/arch/arm32/src/eabi.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global __aeabi_idiv
    32 .global __aeabi_uidiv
    33 
    34 .global __aeabi_idivmod
    35 .global __aeabi_uidivmod
    36 
    37 .global __aeabi_ldivmod
    38 .global __aeabi_uldivmod
    39 
    40 __aeabi_idiv:
     33FUNCTION_BEGIN(__aeabi_idiv)
    4134        push {lr}
    4235        bl __divsi3
    4336        pop {lr}
    4437        mov pc, lr
     38FUNCTION_END(__aeabi_idiv)
    4539
    46 __aeabi_uidiv:
     40FUNCTION_BEGIN(__aeabi_uidiv)
    4741        push {lr}
    4842        bl __udivsi3
    4943        pop {lr}
    5044        mov pc, lr
     45FUNCTION_END(__aeabi_uidiv)
    5146
    52 __aeabi_idivmod:
     47FUNCTION_BEGIN(__aeabi_idivmod)
    5348        push {lr}
    5449        sub sp, sp, #12
     
    5954        pop {lr}
    6055        mov pc, lr
     56FUNCTION_END(__aeabi_idivmod)
    6157
    62 __aeabi_uidivmod:
     58FUNCTION_BEGIN(__aeabi_uidivmod)
    6359        push {lr}
    6460        sub sp, sp, #12
     
    6965        pop {lr}
    7066        mov pc, lr
     67FUNCTION_END(__aeabi_uidivmod)
    7168
    72 __aeabi_ldivmod:
     69FUNCTION_BEGIN(__aeabi_ldivmod)
    7370        push {lr}
    7471        sub sp, sp, #24
     
    8077        pop {lr}
    8178        mov pc, lr
     79FUNCTION_END(__aeabi_ldivmod)
    8280
    83 __aeabi_uldivmod:
     81FUNCTION_BEGIN(__aeabi_uldivmod)
    8482        push {lr}
    8583        sub sp, sp, #24
     
    9189        pop {lr}
    9290        mov pc, lr
     91FUNCTION_END(__aeabi_uldivmod)
     92
  • kernel/arch/arm32/src/exc_handler.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text   
    30 
    31 .global irq_exception_entry
    32 .global fiq_exception_entry
    33 .global data_abort_exception_entry
    34 .global prefetch_abort_exception_entry
    35 .global undef_instr_exception_entry
    36 .global swi_exception_entry
    37 .global reset_exception_entry
    38 
    3932
    4033# Switches to kernel stack and saves all registers there.
     
    156149.endm
    157150
    158 reset_exception_entry:
     151SYMBOL(reset_exception_entry)
    159152        SAVE_REGS_TO_STACK
    160153        mov r0, #0
     
    163156        LOAD_REGS_FROM_STACK
    164157
    165 irq_exception_entry:
     158SYMBOL(irq_exception_entry)
    166159        sub lr, lr, #4
    167160        SAVE_REGS_TO_STACK
     
    171164        LOAD_REGS_FROM_STACK
    172165
    173 fiq_exception_entry:
     166SYMBOL(fiq_exception_entry)
    174167        sub lr, lr, #4
    175168        SAVE_REGS_TO_STACK
     
    179172        LOAD_REGS_FROM_STACK
    180173
    181 undef_instr_exception_entry:
     174SYMBOL(undef_instr_exception_entry)
    182175        SAVE_REGS_TO_STACK
    183176        mov r0, #1
     
    186179        LOAD_REGS_FROM_STACK
    187180
    188 prefetch_abort_exception_entry:
     181SYMBOL(prefetch_abort_exception_entry)
    189182        sub lr, lr, #4
    190183        SAVE_REGS_TO_STACK
     
    194187        LOAD_REGS_FROM_STACK
    195188
    196 data_abort_exception_entry:
     189SYMBOL(data_abort_exception_entry)
    197190        sub lr, lr, #8
    198191        SAVE_REGS_TO_STACK
     
    202195        LOAD_REGS_FROM_STACK
    203196
    204 swi_exception_entry:
     197SYMBOL(swi_exception_entry)
    205198        ldr r13, =exc_stack
    206199        SAVE_REGS_TO_STACK
  • kernel/arch/arm32/src/fpu.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global fpsid_read
    32 .global mvfr0_read
    33 .global fpscr_read
    34 .global fpscr_write
    35 .global fpexc_read
    36 .global fpexc_write
    37 
    38 .global fpu_context_save_s32
    39 .global fpu_context_restore_s32
    40 .global fpu_context_save_d16
    41 .global fpu_context_restore_d16
    42 .global fpu_context_save_d32
    43 .global fpu_context_restore_d32
    44 
    45 fpsid_read:
     33FUNCTION_BEGIN(fpsid_read)
    4634        vmrs r0, fpsid
    4735        mov pc, lr
     36FUNCTION_END(fpsid_read)
    4837
    49 mvfr0_read:
     38FUNCTION_BEGIN(mvfr0_read)
    5039        vmrs r0, mvfr0
    5140        mov pc, lr
     41FUNCTION_END(mvfr0_read)
    5242
    53 fpscr_read:
     43FUNCTION_BEGIN(fpscr_read)
    5444        vmrs r0, fpscr
    5545        mov pc, lr
     46FUNCTION_END(fpscr_read)
    5647
    57 fpscr_write:
     48FUNCTION_BEGIN(fpscr_write)
    5849        vmsr fpscr, r0
    5950        mov pc, lr
     51FUNCTION_END(fpscr_write)
    6052
    61 fpexc_read:
     53FUNCTION_BEGIN(fpexc_read)
    6254        vmrs r0, fpexc
    6355        mov pc, lr
     56FUNCTION_END(fpexc_read)
    6457
    65 fpexc_write:
     58FUNCTION_BEGIN(fpexc_write)
    6659        vmsr fpexc, r0
    6760        mov pc, lr
     61FUNCTION_END(fpexc_write)
    6862
    69 fpu_context_save_s32:
     63FUNCTION_BEGIN(fpu_context_save_s32)
    7064        vmrs r1, fpexc
    7165        vmrs r2, fpscr
     
    7367        vstmia r0!, {s0-s31}
    7468        mov pc, lr
     69FUNCTION_END(fpu_context_save_s32)
    7570
    76 fpu_context_restore_s32:
     71FUNCTION_BEGIN(fpu_context_restore_s32)
    7772        ldmia r0!, {r1, r2}
    7873        vmsr fpexc, r1
     
    8075        vldmia r0!, {s0-s31}
    8176        mov pc, lr
     77FUNCTION_END(fpu_context_restore_s32)
    8278
    83 fpu_context_save_d16:
     79FUNCTION_BEGIN(fpu_context_save_d16)
    8480        vmrs r1, fpexc
    8581        vmrs r2, fpscr
     
    8783        vstmia r0!, {d0-d15}
    8884        mov pc, lr
     85FUNCTION_END(fpu_context_save_d16)
    8986
    90 fpu_context_restore_d16:
     87FUNCTION_BEGIN(fpu_context_restore_d16)
    9188        ldmia r0!, {r1, r2}
    9289        vmsr fpexc, r1
     
    9491        vldmia r0!, {d0-d15}
    9592        mov pc, lr
     93FUNCTION_END(fpu_context_restore_d16)
    9694
    97 fpu_context_save_d32:
     95FUNCTION_BEGIN(fpu_context_save_d32)
    9896        vmrs r1, fpexc
    9997        stmia r0!, {r1}
     
    103101        vstmia r0!, {d16-d31}
    104102        mov pc, lr
     103FUNCTION_END(fpu_context_save_d32)
    105104
    106 fpu_context_restore_d32:
     105FUNCTION_BEGIN(fpu_context_restore_d32)
    107106        ldmia r0!, {r1, r2}
    108107        vmsr fpexc, r1
     
    111110        vldmia r0!, {d16-d31}
    112111        mov pc, lr
     112FUNCTION_END(fpu_context_restore_d32)
    113113
    114 
    115 
  • kernel/arch/arm32/src/start.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/boot.h>
    3031
    3132.text
    3233
    33 .global kernel_image_start
    34 .global exc_stack
    35 .global supervisor_sp
    36 
    37 kernel_image_start:
    38 
     34SYMBOL(kernel_image_start)
    3935        # initialize Stack pointer for exception modes
    4036        mrs r4, cpsr
     
    8379
    8480        .space 1024
    85 exc_stack:
     81SYMBOL(exc_stack)
    8682
    87 supervisor_sp:
     83SYMBOL(supervisor_sp)
    8884        .space 4
  • kernel/arch/ia32/Makefile.inc

    r6adb775f r32573ff  
    8989        arch/$(KARCH)/src/smp/ipi.c \
    9090        arch/$(KARCH)/src/ia32.c \
     91        arch/$(KARCH)/src/vreg.c \
    9192        arch/$(KARCH)/src/interrupt.c \
    9293        arch/$(KARCH)/src/pm.c \
  • kernel/arch/ia32/include/arch/asm.h

    r6adb775f r32573ff  
    439439        asm volatile (
    440440                "ltr %[sel]"
     441                :: [sel] "r" (sel)
     442        );
     443}
     444
     445/** Load GS from descriptor table.
     446 *
     447 * @param sel Selector specifying descriptor of the GS segment.
     448 *
     449 */
     450NO_TRACE static inline void gs_load(uint16_t sel)
     451{
     452        asm volatile (
     453                "mov %[sel], %%gs"
    441454                :: [sel] "r" (sel)
    442455        );
  • kernel/arch/ia32/include/arch/context_struct.ag

    r6adb775f r32573ff  
    6666                },
    6767                {
     68                        name : tp,
     69                        type : uint32_t
     70                },
     71
     72                {
    6873                        name : ipl,
    6974                        type : ipl_t
  • kernel/arch/ia32/include/arch/pm.h

    r6adb775f r32573ff  
    4545#define UDATA_DES  4
    4646#define TSS_DES    5
    47 #define TLS_DES    6  /* Pointer to Thread-Local-Storage data */
     47#define VREG_DES   6  /* Virtual registers */
    4848
    4949#ifdef CONFIG_FB
     
    169169
    170170extern void tss_initialize(tss_t *t);
    171 extern void set_tls_desc(uintptr_t tls);
    172171
    173172#endif /* __ASM__ */
  • kernel/arch/ia32/include/arch/proc/thread.h

    r6adb775f r32573ff  
    3939
    4040typedef struct {
    41         sysarg_t tls;
    4241} thread_arch_t;
    4342
  • kernel/arch/ia32/src/asm.S

    r6adb775f r32573ff  
    183183
    184184        /*
    185          * Save TLS.
    186          */
    187         movl %gs, %edx
    188         movl %edx, ISTATE_OFFSET_GS(%esp)
    189 
    190         /*
    191185         * Switch to kernel selectors.
    192186         */
    193         movw $(GDT_SELECTOR(KDATA_DES)), %ax
    194         movw %ax, %ds
    195         movw %ax, %es
     187        movl $(GDT_SELECTOR(KDATA_DES)), %eax
     188        movl %eax, %ds
     189        movl %eax, %es
     190        movl $(GDT_SELECTOR(VREG_DES)), %eax
     191        movl %eax, %gs
    196192       
    197193        /*
     
    213209       
    214210        /*
    215          * Restore TLS.
    216          */
    217         movl ISTATE_OFFSET_GS(%esp), %edx
    218         movl %edx, %gs
    219        
    220         /*
    221211         * Prepare return address and userspace stack for SYSEXIT.
    222212         */
     
    252242
    253243        /*
    254          * Save the selector registers.
     244         * Save the segment registers.
    255245         */
    256246        movl %gs, %ecx
     
    272262        movl %eax, %ds
    273263        movl %eax, %es
     264        movl $(GDT_SELECTOR(VREG_DES)), %eax
     265        movl %eax, %gs
    274266               
    275267        movl $0, ISTATE_OFFSET_EBP_FRAME(%esp)
     
    284276                       
    285277        /*
    286          * Restore the selector registers.
     278         * Restore the segment registers.
    287279         */
    288280        movl ISTATE_OFFSET_GS(%esp), %ecx
     
    354346       
    355347        /*
    356          * Save the selector registers.
     348         * Save the segment registers.
    357349         */
    358350        movl %gs, %ecx
     
    374366        movl %eax, %ds
    375367        movl %eax, %es
     368        movl $(GDT_SELECTOR(VREG_DES)), %eax
     369        movl %eax, %gs
    376370       
    377371        /*
  • kernel/arch/ia32/src/context.S

    r6adb775f r32573ff  
    2929#include <abi/asmtool.h>
    3030#include <arch/context_struct.h>
     31#include <arch/vreg.h>
    3132
    3233.text
     
    4849        movl %edi, CONTEXT_OFFSET_EDI(%edx)     # %edi -> ctx->edi
    4950        movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
     51
     52        mov vreg_ptr, %ecx
     53        movl %gs:VREG_TP(%ecx), %ecx
     54        movl %ecx, CONTEXT_OFFSET_TP(%edx)
    5055
    5156        xorl %eax, %eax         # context_save returns 1
     
    7277
    7378        movl %edx, 0(%esp)      # put saved pc on stack
     79
     80        mov vreg_ptr, %ecx
     81        movl CONTEXT_OFFSET_TP(%eax), %edx
     82        movl %edx, %gs:VREG_TP(%ecx)
     83
    7484        xorl %eax, %eax         # context_restore returns 0
    7585        ret
    76 FUNCTION_END(context_restore_arch)
  • kernel/arch/ia32/src/ia32.c

    r6adb775f r32573ff  
    5757#include <genarch/multiboot/multiboot.h>
    5858#include <genarch/multiboot/multiboot2.h>
     59#include <arch/pm.h>
     60#include <arch/vreg.h>
    5961
    6062#ifdef CONFIG_SMP
     
    9698void arch_post_mm_init(void)
    9799{
     100        vreg_init();
     101
    98102        if (config.cpu_active == 1) {
    99103                /* Initialize IRQ routing */
     
    122126                zone_merge_all();
    123127        }
     128
    124129}
    125130
     
    216221}
    217222
    218 /** Set thread-local-storage pointer
    219  *
    220  * TLS pointer is set in GS register. That means, the GS contains
    221  * selector, and the descriptor->base is the correct address.
    222  */
    223 sysarg_t sys_tls_set(uintptr_t addr)
    224 {
    225         THREAD->arch.tls = addr;
    226         set_tls_desc(addr);
    227        
    228         return EOK;
    229 }
    230 
    231223/** Construct function pointer
    232224 *
  • kernel/arch/ia32/src/pm.c

    r6adb775f r32573ff  
    4141#include <panic.h>
    4242#include <arch/mm/page.h>
     43#include <mm/km.h>
     44#include <mm/frame.h>
    4345#include <mm/slab.h>
    4446#include <memstr.h>
     
    5153
    5254/*
    53  * We have no use for segmentation so we set up flat mode. In this
    54  * mode, we use, for each privilege level, two segments spanning the
     55 * We don't have much use for segmentation so we set up flat mode.
     56 * In this mode, we use, for each privilege level, two segments spanning the
    5557 * whole memory. One is for code and one is for data.
    5658 *
    57  * One is for GS register which holds pointer to the TLS thread
    58  * structure in it's base.
     59 * One special segment apart of that is for the GS register which holds
     60 * a pointer to the VREG page in its base.
    5961 */
    6062descriptor_t gdt[GDT_ITEMS] = {
     
    7173        /* TSS descriptor - set up will be completed later */
    7274        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
    73         /* TLS descriptor */
    74         { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
     75        /* VREG descriptor - segment used for virtual registers, will be reinitialized later */
     76        { 0xffff, 0 , 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
    7577        /* VESA Init descriptor */
    7678#ifdef CONFIG_FB
     
    8284static idescriptor_t idt[IDT_ITEMS];
    8385
    84 static tss_t tss;
     86static tss_t tss0;
    8587
    8688tss_t *tss_p = NULL;
     
    9597{
    9698        d->base_0_15 = base & 0xffff;
    97         d->base_16_23 = ((base) >> 16) & 0xff;
    98         d->base_24_31 = ((base) >> 24) & 0xff;
     99        d->base_16_23 = (base >> 16) & 0xff;
     100        d->base_24_31 = (base >> 24) & 0xff;
    99101}
    100102
     
    265267                 * the heap hasn't been initialized so far.
    266268                 */
    267                 tss_p = &tss;
    268         }
    269         else {
     269                tss_p = &tss0;
     270        } else {
    270271                tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC);
    271272                if (!tss_p)
     
    292293}
    293294
    294 void set_tls_desc(uintptr_t tls)
    295 {
    296         ptr_16_32_t cpugdtr;
    297         descriptor_t *gdt_p;
    298 
    299         gdtr_store(&cpugdtr);
    300         gdt_p = (descriptor_t *) cpugdtr.base;
    301         gdt_setbase(&gdt_p[TLS_DES], tls);
    302         /* Reload gdt register to update GS in CPU */
    303         gdtr_load(&cpugdtr);
    304 }
    305 
    306295/** @}
    307296 */
  • kernel/arch/ia32/src/proc/scheduler.c

    r6adb775f r32573ff  
    7070        CPU->arch.tss->esp0 = kstk;
    7171        CPU->arch.tss->ss0 = GDT_SELECTOR(KDATA_DES);
    72        
    73         /* Set up TLS in GS register */
    74         set_tls_desc(THREAD->arch.tls);
    7572}
    7673
  • kernel/arch/ia32/src/proc/thread.c

    r6adb775f r32573ff  
    4141void thread_create_arch(thread_t *t)
    4242{
    43         t->arch.tls = 0;
    4443}
    4544
  • kernel/arch/ia32/src/userspace.c

    r6adb775f r32573ff  
    5959                "popfl\n"
    6060               
    61                 /* Set up GS register (TLS) */
    62                 "movl %[tls_des], %%gs\n"
     61                /* Set up GS register (virtual register segment) */
     62                "movl %[vreg_des], %%gs\n"
    6363               
    6464                "pushl %[udata_des]\n"
     
    8181                  [entry] "r" (kernel_uarg->uspace_entry),
    8282                  [uarg] "r" (kernel_uarg->uspace_uarg),
    83                   [tls_des] "r" (GDT_SELECTOR(TLS_DES))
     83                  [vreg_des] "r" (GDT_SELECTOR(VREG_DES))
    8484                : "eax");
    8585       
  • kernel/arch/ia64/Makefile.inc

    r6adb775f r32573ff  
    4343        arch/$(KARCH)/src/start.S \
    4444        arch/$(KARCH)/src/asm.S \
    45         arch/$(KARCH)/src/dummy.s \
     45        arch/$(KARCH)/src/dummy.S \
    4646        arch/$(KARCH)/src/ia64.c \
    4747        arch/$(KARCH)/src/fpu_context.c \
  • kernel/arch/ia64/src/asm.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/register.h>
    3031
    3132.text
    32 .global memcpy_from_uspace
    33 .global memcpy_to_uspace
    34 .global memcpy_from_uspace_failover_address
    35 .global memcpy_to_uspace_failover_address
    3633
    3734/** Copy memory from/to userspace.
     
    4643 *
    4744 */
    48 memcpy_from_uspace:
    49 memcpy_to_uspace:
     45FUNCTION_BEGIN(memcpy_from_uspace)
     46FUNCTION_BEGIN(memcpy_to_uspace)
    5047        alloc loc0 = ar.pfs, 3, 1, 0, 0
    5148       
     
    132129                mov ar.pfs = loc0
    133130                br.ret.sptk.many rp
     131FUNCTION_END(memcpy_from_uspace)
     132FUNCTION_END(memcpy_to_uspace)
    134133
    135 memcpy_from_uspace_failover_address:
    136 memcpy_to_uspace_failover_address:
     134SYMBOL(memcpy_from_uspace_failover_address)
     135SYMBOL(memcpy_to_uspace_failover_address)
    137136        /* Return 0 on failure */
    138137        mov r8 = r0
     
    140139        br.ret.sptk.many rp
    141140
    142 .global cpu_halt
    143 cpu_halt:
     141FUNCTION_BEGIN(cpu_halt)
    144142        br cpu_halt
     143FUNCTION_END(cpu_halt)
    145144
    146145/** Switch to userspace - low level code.
     
    154153 *
    155154 */
    156 .global switch_to_userspace
    157 switch_to_userspace:
     155FUNCTION_BEGIN(switch_to_userspace)
    158156        alloc loc0 = ar.pfs, 6, 3, 0, 0
    159157       
     
    191189       
    192190        rfi ;;
     191FUNCTION_END(switch_to_userspace)
    193192
    194 .global early_putchar
    195 early_putchar:
     193FUNCTION_BEGIN(early_putchar)
    196194        br.ret.sptk.many b0
     195FUNCTION_END(early_putchar)
  • kernel/arch/ia64/src/context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031
    3132.text
    3233
    33 .global context_save_arch
    34 .global context_restore_arch
    35 
    36 context_save_arch:
     34FUNCTION_BEGIN(context_save_arch)
    3735        alloc loc0 = ar.pfs, 1, 49, 0, 0
    3836        mov loc1 = ar.unat ;;
     
    182180        add r8 = r0, r0, 1      /* context_save returns 1 */
    183181        br.ret.sptk.many b0
    184 
    185 context_restore_arch:
     182FUNCTION_END(context_save_arch)
     183
     184FUNCTION_BEGIN(context_restore_arch)
    186185        alloc loc0 = ar.pfs, 1, 50, 0, 0        ;;
    187186
     
    338337        mov r8 = r0                     /* context_restore returns 0 */
    339338        br.ret.sptk.many b0
    340 
     339FUNCTION_END(context_restore_arch)
     340
  • kernel/arch/ia64/src/debug/stacktrace_asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global frame_pointer_get
    32 .global program_counter_get
    33 
    34 frame_pointer_get:
     33FUNCTION_BEGIN(frame_pointer_get)
    3534        mov r8 = r0
    3635        br.ret.sptk.many b0
     36FUNCTION_END(frame_pointer_get)
    3737
    38 program_counter_get:
     38FUNCTION_BEGIN(program_counter_get)
    3939        mov r8 = r0
    4040        br.ret.sptk.many b0
     41FUNCTION_END(program_counter_get)
     42
  • kernel/arch/ia64/src/dummy.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global cpu_sleep
    32 .global sys_tls_set
     33FUNCTION_BEGIN(calibrate_delay_loop)
     34FUNCTION_BEGIN(asm_delay_loop)
     35FUNCTION_BEGIN(cpu_sleep)
     36        br.ret.sptk.many b0
     37FUNCTION_END(calibrate_delay_loop)
     38FUNCTION_END(asm_delay_loop)
     39FUNCTION_END(cpu_sleep)
    3340
    34 .global dummy
    35 
    36 cpu_sleep:              ! not supported by architecture
    37 sys_tls_set:            ! not needed on architecture
    38 
    39 dummy:
    40         retl
    41         nop
    42 
    43 .global cpu_halt
    44 cpu_halt:
    45         ba %xcc, cpu_halt
    46         nop
  • kernel/arch/ia64/src/ia64.c

    r6adb775f r32573ff  
    250250}
    251251
    252 /** Set thread-local-storage pointer.
    253  *
    254  * We use r13 (a.k.a. tp) for this purpose.
    255  */
    256 sysarg_t sys_tls_set(uintptr_t addr)
    257 {
    258         return EOK;
    259 }
    260 
    261252void arch_reboot(void)
    262253{
  • kernel/arch/ia64/src/ivt.S

    r6adb775f r32573ff  
    2828#
    2929
     30#include <abi/asmtool.h>
    3031#include <arch/stack.h>
    3132#include <arch/register.h>
     
    101102.endm
    102103
    103 .global heavyweight_handler
    104 heavyweight_handler:
     104SYMBOL(heavyweight_handler)
    105105    /* 1. copy interrupt registers into bank 0 */
    106106   
     
    297297        rfi ;;
    298298
    299 .global heavyweight_handler_inner
    300 heavyweight_handler_inner:
     299FUNCTION_BEGIN(heavyweight_handler_inner)
    301300        /*
    302301         * From this point, the rest of the interrupted context
     
    538537        mov ar.pfs = loc0
    539538        br.ret.sptk.many b0
    540 
    541 .global ivt
     539FUNCTION_END(heavyweight_handler_inner)
     540
    542541.align 32768
    543 ivt:
     542SYMBOL(ivt)
    544543        HEAVYWEIGHT_HANDLER 0x00
    545544        HEAVYWEIGHT_HANDLER 0x04
  • kernel/arch/ia64/src/start.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/register.h>
    3031#include <arch/mm/page.h>
     
    4142.section K_TEXT_START, "ax"
    4243
    43 .global kernel_image_start
    44 
    4544stack0:
    4645
     
    5352#       r2      Address of the boot code's bootinfo structure.
    5453#
    55 kernel_image_start:
     54SYMBOL(kernel_image_start)
    5655        .auto
    5756       
     
    113112        rfi ;;
    114113
    115 .global paging_start
    116114paging_start:
    117115       
  • kernel/arch/mips32/src/asm.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/fpu_context_struct.h>
     
    4849.set nomacro
    4950
    50 .global asm_delay_loop
    51 asm_delay_loop:
     51FUNCTION_BEGIN(asm_delay_loop)
    5252        j $31
    5353        nop
    54 
    55 .global cpu_halt
    56 cpu_halt:
     54FUNCTION_END(asm_delay_loop)
     55
     56FUNCTION_BEGIN(cpu_halt)
    5757        j cpu_halt
    5858        nop
    59 
    60 .global memcpy_from_uspace
    61 .global memcpy_to_uspace
    62 .global memcpy_from_uspace_failover_address
    63 .global memcpy_to_uspace_failover_address
    64 memcpy_from_uspace:
    65 memcpy_to_uspace:
     59FUNCTION_END(cpu_halt)
     60
     61FUNCTION_BEGIN(memcpy_from_uspace)
     62FUNCTION_BEGIN(memcpy_to_uspace)
    6663        move $t2, $a0  /* save dst */
    6764       
     
    129126                jr $ra
    130127                move $v0, $t2
    131 
    132 memcpy_from_uspace_failover_address:
    133 memcpy_to_uspace_failover_address:
     128FUNCTION_END(memcpy_from_uspace)
     129FUNCTION_END(memcpy_to_uspace)
     130
     131SYMBOL(memcpy_from_uspace_failover_address)
     132SYMBOL(memcpy_to_uspace_failover_address)
    134133        jr $ra
    135134        move $v0, $zero
     
    155154.endm
    156155
    157 .global fpu_context_save
    158 fpu_context_save:
     156FUNCTION_BEGIN(fpu_context_save)
    159157#ifdef CONFIG_FPU
    160158        fpu_gp_save 0, $a0
     
    225223        j $ra
    226224        nop
    227 
    228 .global fpu_context_restore
    229 fpu_context_restore:
     225FUNCTION_END(fpu_context_save)
     226
     227FUNCTION_BEGIN(fpu_context_restore)
    230228#ifdef CONFIG_FPU
    231229        fpu_gp_restore 0, $a0
     
    296294        j $ra
    297295        nop
    298 
    299 .global early_putchar
    300 early_putchar:
     296FUNCTION_END(fpu_context_restore)
     297
     298FUNCTION_BEGIN(early_putchar)
    301299        j $ra
    302300        nop
     301FUNCTION_END(early_putchar)
  • kernel/arch/mips32/src/context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031
     
    3536.set nomacro
    3637
    37 .global context_save_arch
    38 .global context_restore_arch
    39 
    40 context_save_arch:
     38FUNCTION_BEGIN(context_save_arch)
    4139        sw $s0, CONTEXT_OFFSET_S0($a0)
    4240        sw $s1, CONTEXT_OFFSET_S1($a0)
     
    5654        j $31
    5755        li $2, 1
     56FUNCTION_END(context_save_arch)
    5857
    59 context_restore_arch:
     58FUNCTION_BEGIN(context_restore_arch)
    6059        lw $s0, CONTEXT_OFFSET_S0($a0)
    6160        lw $s1, CONTEXT_OFFSET_S1($a0)
     
    7574        j $31
    7675        xor $2, $2
     76FUNCTION_END(context_restore_arch)
  • kernel/arch/mips32/src/debug/stacktrace_asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
     
    3234.set noreorder
    3335
    34 .global frame_pointer_get
    35 .global program_counter_get
    36 
    37 frame_pointer_get:
     36FUNCTION_BEGIN(frame_pointer_get)
    3837        j $ra
    3938        move $v0, $sp
     39FUNCTION_END(frame_pointer_get)
    4040
    41 program_counter_get:
     41FUNCTION_BEGIN(program_counter_get)
    4242        j $ra
    4343        move $v0, $ra
     44FUNCTION_END(program_counter_get)
  • kernel/arch/mips32/src/mips32.c

    r6adb775f r32573ff  
    187187}
    188188
    189 /** Set thread-local-storage pointer
    190  *
    191  * We have it currently in K1, it is
    192  * possible to have it separately in the future.
    193  */
    194 sysarg_t sys_tls_set(uintptr_t addr)
    195 {
    196         return EOK;
    197 }
    198 
    199189void arch_reboot(void)
    200190{
  • kernel/arch/mips32/src/start.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/mm/page.h>
     
    3839.set noreorder
    3940.set nomacro
    40 
    41 .global kernel_image_start
    42 .global tlb_refill_entry
    43 .global cache_error_entry
    44 .global exception_entry
    45 .global userspace_asm
    4641
    4742/*
     
    192187
    193188.org 0x0
    194 kernel_image_start:
     189SYMBOL(kernel_image_start)
    195190        /* load temporary stack */
    196191        lui $sp, %hi(end_stack)
     
    210205end_stack:
    211206
    212 tlb_refill_entry:
     207SYMBOL(tlb_refill_entry)
    213208        j tlb_refill_handler
    214209        nop
    215210
    216 cache_error_entry:
     211SYMBOL(cache_error_entry)
    217212        j cache_error_handler
    218213        nop
    219214
    220 exception_entry:
     215SYMBOL(exception_entry)
    221216        j exception_handler
    222217        nop
     
    345340        eret
    346341
    347 userspace_asm:
     342FUNCTION_BEGIN(userspace_asm)
    348343        move $sp, $a0
    349344        move $v0, $a1
     
    352347                           /* set it to 0 */
    353348        eret
     349FUNCTION_END(userspace_asm)
  • kernel/arch/ppc32/Makefile.inc

    r6adb775f r32573ff  
    4545        arch/$(KARCH)/src/boot/boot.S \
    4646        arch/$(KARCH)/src/ppc32.c \
    47         arch/$(KARCH)/src/dummy.s \
     47        arch/$(KARCH)/src/dummy.S \
    4848        arch/$(KARCH)/src/exception.S \
    4949        arch/$(KARCH)/src/interrupt.c \
  • kernel/arch/ppc32/src/asm.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/msr.h>
     
    3334.text
    3435
    35 .global userspace_asm
    36 .global iret
    37 .global iret_syscall
    38 .global memcpy_from_uspace
    39 .global memcpy_to_uspace
    40 .global memcpy_from_uspace_failover_address
    41 .global memcpy_to_uspace_failover_address
    42 .global early_putchar
    43 
    44 userspace_asm:
    45        
     36FUNCTION_BEGIN(userspace_asm)
    4637        /*
    4738         * r3 = uspace_uarg
     
    7869       
    7970        rfi
    80 
    81 iret:
    82        
     71FUNCTION_END(userspace_asm)
     72
     73SYMBOL(iret)
    8374        /* Disable interrupts */
    8475       
     
    142133        rfi
    143134
    144 iret_syscall:
    145        
     135SYMBOL(iret_syscall)
    146136        /* Disable interrupts */
    147137       
     
    204194        rfi
    205195
    206 memcpy_from_uspace:
    207 memcpy_to_uspace:
    208        
     196FUNCTION_BEGIN(memcpy_from_uspace)
     197FUNCTION_BEGIN(memcpy_to_uspace)
    209198        srwi. r7, r5, 3
    210199        addi r6, r3, -4
     
    267256                mtctr r7
    268257                b 1b
    269 
    270 memcpy_from_uspace_failover_address:
    271 memcpy_to_uspace_failover_address:
     258FUNCTION_END(memcpy_from_uspace)
     259FUNCTION_END(memcpy_to_uspace)
     260
     261SYMBOL(memcpy_from_uspace_failover_address)
     262SYMBOL(memcpy_to_uspace_failover_address)
    272263        /* Return zero, failure */
    273264        xor r3, r3, r3
    274265        blr
    275266
    276 early_putchar:
     267FUNCTION_BEGIN(early_putchar)
    277268        blr
     269FUNCTION_END(early_putchar)
  • kernel/arch/ppc32/src/boot/boot.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <config.h>
     
    3233.section K_TEXT_START, "ax"
    3334
    34 .global kernel_image_start
    35 kernel_image_start:
    36        
     35SYMBOL(kernel_image_start)
    3736        # load temporal kernel stack
    3837       
  • kernel/arch/ppc32/src/context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031#include <arch/asm/regname.h>
     
    3233.text
    3334
    34 .global context_save_arch
    35 .global context_restore_arch
    36 
    37 context_save_arch:
     35FUNCTION_BEGIN(context_save_arch)
    3836        stw sp, CONTEXT_OFFSET_SP(r3)
    3937        stw r2, CONTEXT_OFFSET_R2(r3)
     
    6765        li r3, 1
    6866        blr
     67FUNCTION_END(context_save_arch)
    6968
    70 context_restore_arch:
     69FUNCTION_BEGIN(context_restore_arch)
    7170        lwz sp, CONTEXT_OFFSET_SP(r3)
    7271        lwz r2, CONTEXT_OFFSET_R2(r3)
     
    10099        li r3, 0
    101100        blr
     101FUNCTION_END(context_restore_arch)
  • kernel/arch/ppc32/src/debug/stacktrace_asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031
    3132.text
    3233
    33 .global frame_pointer_get
    34 .global program_counter_get
    35 
    36 frame_pointer_get:
     34FUNCTION_BEGIN(frame_pointer_get)
    3735        mr r3, sp
    3836        blr
     37FUNCTION_END(frame_pointer_get)
    3938
    40 program_counter_get:
     39FUNCTION_BEGIN(program_counter_get)
    4140        mflr r3
    4241        blr
     42FUNCTION_END(program_counter_get)
  • kernel/arch/ppc32/src/dummy.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global asm_delay_loop
    32 .global sys_tls_set
    33 .global cpu_halt
     33FUNCTION_BEGIN(asm_delay_loop)
     34        blr
     35FUNCTION_END(asm_delay_loop)
    3436
    35 sys_tls_set:
    36         b sys_tls_set
    37 
    38 asm_delay_loop:
    39         blr
    40 
    41 cpu_halt:
     37FUNCTION_BEGIN(cpu_halt)
    4238        b cpu_halt
     39FUNCTION_END(cpu_halt)
  • kernel/arch/ppc32/src/exception.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/msr.h>
     
    126127
    127128.org 0x100
    128 .global exc_system_reset
    129 exc_system_reset:
     129SYMBOL(exc_system_reset)
    130130        CONTEXT_STORE
    131131       
     
    134134
    135135.org 0x200
    136 .global exc_machine_check
    137 exc_machine_check:
     136SYMBOL(exc_machine_check)
    138137        CONTEXT_STORE
    139138       
     
    142141
    143142.org 0x300
    144 .global exc_data_storage
    145 exc_data_storage:
     143SYMBOL(exc_data_storage)
    146144        CONTEXT_STORE
    147145       
     
    150148
    151149.org 0x400
    152 .global exc_instruction_storage
    153 exc_instruction_storage:
     150SYMBOL(exc_instruction_storage)
    154151        CONTEXT_STORE
    155152       
     
    158155
    159156.org 0x500
    160 .global exc_external
    161 exc_external:
     157SYMBOL(exc_external)
    162158        CONTEXT_STORE
    163159       
     
    166162
    167163.org 0x600
    168 .global exc_alignment
    169 exc_alignment:
     164SYMBOL(exc_alignment)
    170165        CONTEXT_STORE
    171166       
     
    174169
    175170.org 0x700
    176 .global exc_program
    177 exc_program:
     171SYMBOL(exc_program)
    178172        CONTEXT_STORE
    179173       
     
    182176
    183177.org 0x800
    184 .global exc_fp_unavailable
    185 exc_fp_unavailable:
     178SYMBOL(exc_fp_unavailable)
    186179        CONTEXT_STORE
    187180       
     
    190183
    191184.org 0x900
    192 .global exc_decrementer
    193 exc_decrementer:
     185SYMBOL(exc_decrementer)
    194186        CONTEXT_STORE
    195187       
     
    198190
    199191.org 0xa00
    200 .global exc_reserved0
    201 exc_reserved0:
     192SYMBOL(exc_reserved0)
    202193        CONTEXT_STORE
    203194       
     
    206197
    207198.org 0xb00
    208 .global exc_reserved1
    209 exc_reserved1:
     199SYMBOL(exc_reserved1)
    210200        CONTEXT_STORE
    211201       
     
    214204
    215205.org 0xc00
    216 .global exc_syscall
    217 exc_syscall:
     206SYMBOL(exc_syscall)
    218207        CONTEXT_STORE
    219208       
     
    221210
    222211.org 0xd00
    223 .global exc_trace
    224 exc_trace:
     212SYMBOL(exc_trace)
    225213        CONTEXT_STORE
    226214       
     
    229217
    230218.org 0x1000
    231 .global exc_itlb_miss
    232 exc_itlb_miss:
     219SYMBOL(exc_itlb_miss)
    233220        CONTEXT_STORE
    234221       
     
    237224
    238225.org 0x1100
    239 .global exc_dtlb_miss_load
    240 exc_dtlb_miss_load:
     226SYMBOL(exc_dtlb_miss_load)
    241227        CONTEXT_STORE
    242228       
     
    245231
    246232.org 0x1200
    247 .global exc_dtlb_miss_store
    248 exc_dtlb_miss_store:
     233SYMBOL(exc_dtlb_miss_store)
    249234        CONTEXT_STORE
    250235       
  • kernel/arch/ppc32/src/fpu_context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/fpu_context_struct.h>
     
    3233
    3334.text
    34 
    35 .global fpu_context_save
    36 .global fpu_context_restore
    37 .global fpu_init
    38 .global fpu_enable
    39 .global fpu_disable
    4035
    4136.macro FPU_CONTEXT_STORE r
     
    109104.endm
    110105
    111 fpu_context_save:
     106FUNCTION_BEGIN(fpu_context_save)
    112107        FPU_CONTEXT_STORE r3
    113108       
     
    116111       
    117112        blr
     113FUNCTION_END(fpu_context_save)
    118114
    119 fpu_context_restore:
     115FUNCTION_BEGIN(fpu_context_restore)
    120116        lfd fr0, FPU_CONTEXT_OFFSET_FPSCR(r3)
    121117        mtfsf 0xff, fr0
     
    124120       
    125121        blr
     122FUNCTION_END(fpu_context_restore)
    126123
    127 fpu_init:
     124FUNCTION_BEGIN(fpu_init)
    128125        mfmsr r0
    129126        ori r0, r0, MSR_FP
     
    137134       
    138135        blr
     136FUNCTION_END(fpu_init)
    139137
    140 fpu_enable:
     138FUNCTION_BEGIN(fpu_enable)
    141139        mfmsr r0
    142140        ori r0, r0, MSR_FP
     
    144142        isync
    145143        blr
     144FUNCTION_END(fpu_enable)
    146145
    147 fpu_disable:
     146FUNCTION_BEGIN(fpu_disable)
    148147        mfmsr r0
    149148        li r3, MSR_FP
     
    152151        isync
    153152        blr
     153FUNCTION_END(fpu_disable)
  • kernel/arch/sparc32/src/context.S

    r6adb775f r32573ff  
    2828#
    2929
     30#include <abi/asmtool.h>
    3031#include <arch/context_offset.h>
    3132#include <arch/arch.h>
     
    3334.text
    3435
    35 .global context_save_arch
    36 .global context_restore_arch
    37 
    3836/*
    3937 * context_save_arch() is required not to create its own stack frame. See the
    4038 * generic context.h for explanation.
    4139 */
    42 context_save_arch:
     40FUNCTION_BEGIN(context_save_arch)
    4341        #
    4442        # Force all our active register windows to memory so that we can find
     
    6260        retl
    6361        mov 1, %o0              ! context_save_arch returns 1
     62FUNCTION_END(context_save_arch)
    6463
    65 context_restore_arch:
     64FUNCTION_BEGIN(context_restore_arch)
    6665        #
    6766        # Forget all previous windows, they are not going to be needed again.
     
    9796        retl
    9897        xor %o0, %o0, %o0       ! context_restore_arch returns 0
     98FUNCTION_END(context_restore_arch)
  • kernel/arch/sparc32/src/sparc32.c

    r6adb775f r32573ff  
    113113}
    114114
    115 sysarg_t sys_tls_set(uintptr_t addr)
    116 {
    117         return EOK;
    118 }
    119 
    120115/** Construct function pointer
    121116 *
  • kernel/arch/sparc32/src/start.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global kernel_image_start
    32 .global early_putchar
    33 .global kernel_sp
    34 .global uspace_wbuf
    35 
    36 kernel_image_start:
     33SYMBOL(kernel_image_start)
    3734        # Install trap handlers
    3835        set trap_table, %g1
     
    6865        nop
    6966
    70 early_putchar:
     67FUNCTION_BEGIN(early_putchar)
    7168        set 0x80000100, %l0
    7269        cmp %o0, '\n'
     
    8077                retl
    8178                nop
     79FUNCTION_END(early_putchar)
    8280
    83 kernel_sp:
     81SYMBOL(kernel_sp)
    8482.space 4
    8583
    86 uspace_wbuf:
     84SYMBOL(uspace_wbuf)
    8785.space 4
    8886
  • kernel/arch/sparc32/src/trap_table.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/trap.h>
    3031#include <arch/regwin.h>
    3132
    3233.text
    33 
    34 .global trap_table
    35 .global reset_trap
    36 .global preemptible_trap
    37 .global interrupt_trap
    38 .global syscall_trap
    39 .global window_overflow_trap
    40 .global window_underflow_trap
    41 .global write_to_invalid
    42 .global read_from_invalid
    43 .global flush_windows
    4434
    4535.macro get_wim_number reg
     
    218208.endm
    219209
    220 write_to_invalid:
     210FUNCTION_BEGIN(write_to_invalid)
    221211        ! Write value 1
    222212        mov %o0, %g7
     
    236226        retl
    237227        nop
    238 
    239 read_from_invalid:
     228FUNCTION_END(write_to_invalid)
     229
     230FUNCTION_BEGIN(read_from_invalid)
    240231        ! Read value 1
    241232        mov %o0, %g7
     
    255246        retl
    256247        nop
    257 
    258 reset_trap:
     248FUNCTION_END(read_from_invalid)
     249
     250SYMBOL(reset_trap)
    259251        set 0x80000100, %l0
    260252        set 'r', %l1
     
    262254        rett
    263255
    264 window_overflow_trap:
     256SYMBOL(window_overflow_trap)
    265257        mov %g7, %l0
    266258       
     
    393385                rett %l2
    394386
    395 window_underflow_trap:
     387SYMBOL(window_underflow_trap)
    396388        mov %g7, %l0
    397389       
     
    479471                rett %l2
    480472
    481 flush_windows:
     473FUNCTION_BEGIN(flush_windows)
    482474        mov 7, %g1
    483475        1:
     
    494486        retl
    495487        nop
    496 
    497 preemptible_trap:
     488FUNCTION_END(flush_windows)
     489
     490SYMBOL(preemptible_trap)
    498491        /* Save %g7 */
    499492        mov %g7, %l0
     
    670663                rett %l2
    671664
    672 interrupt_trap:
     665SYMBOL(interrupt_trap)
    673666        /* Save %g7 */
    674667        mov %g7, %l0
     
    844837                rett %l2
    845838
    846 syscall_trap:
     839SYMBOL(syscall_trap)
    847840        /* Save %g7 */
    848841        mov %g7, %l0
     
    10511044
    10521045.align TRAP_TABLE_SIZE
    1053 trap_table:
     1046SYMBOL(trap_table)
    10541047        STRAP(0x0, reset_trap)
    10551048        TRAP(0x1, instruction_access_exception)
  • kernel/arch/sparc64/Makefile.inc

    r6adb775f r32573ff  
    6666        arch/$(KARCH)/src/context.S \
    6767        arch/$(KARCH)/src/fpu_context.c \
    68         arch/$(KARCH)/src/dummy.s \
     68        arch/$(KARCH)/src/dummy.S \
    6969        arch/$(KARCH)/src/mm/$(USARCH)/km.c \
    7070        arch/$(KARCH)/src/mm/$(USARCH)/as.c \
  • kernel/arch/sparc64/src/asm.S

    r6adb775f r32573ff  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/arch.h>
    3031#include <arch/stack.h>
     
    3839 * Almost the same as memcpy() except the loads are from userspace.
    3940 */
    40 .global memcpy_from_uspace
    41 memcpy_from_uspace:
     41FUNCTION_BEGIN(memcpy_from_uspace)
    4242        mov %o0, %o3  /* save dst */
    4343        add %o1, 7, %g1
     
    108108                jmp %o7 + 8  /* exit point */
    109109                mov %o3, %o0
     110FUNCTION_END(memcpy_from_uspace)
    110111
    111112/*
    112113 * Almost the same as memcpy() except the stores are to userspace.
    113114 */
    114 .global memcpy_to_uspace
    115 memcpy_to_uspace:
     115FUNCTION_BEGIN(memcpy_to_uspace)
    116116        mov %o0, %o3  /* save dst */
    117117        add %o1, 7, %g1
     
    182182                jmp     %o7 + 8  /* exit point */
    183183                mov     %o3, %o0
     184FUNCTION_END(memcpy_to_uspace)
    184185
    185 .global memcpy_from_uspace_failover_address
    186 .global memcpy_to_uspace_failover_address
    187 memcpy_from_uspace_failover_address:
    188 memcpy_to_uspace_failover_address:
     186SYMBOL(memcpy_from_uspace_failover_address)
     187SYMBOL(memcpy_to_uspace_failover_address)
    189188        jmp %o7 + 8   /* exit point */
    190189        mov %g0, %o0  /* return 0 on failure */
    191190
    192 .global early_putchar
    193 early_putchar:
     191FUNCTION_BEGIN(early_putchar)
    194192        retl
    195193        nop
     194FUNCTION_END(early_putchar)
  • kernel/arch/sparc64/src/context.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031#include <arch/arch.h>
     
    3334.text   
    3435
    35 .global context_save_arch
    36 .global context_restore_arch
    37 
    3836/*
    3937 * context_save_arch() is required not to create its own stack frame. See the
    4038 * generic context.h for explanation.
    4139 */
    42 context_save_arch:
     40FUNCTION_BEGIN(context_save_arch)
    4341        #
    4442        # Force all our active register windows to memory so that we can find
     
    6765        retl
    6866        mov 1, %o0              ! context_save_arch returns 1
     67FUNCTION_END(context_save_arch)
    6968
    70 context_restore_arch:
     69FUNCTION_BEGIN(context_restore_arch)
    7170        #
    7271        # Forget all previous windows, they are not going to be needed again.
     
    106105        retl
    107106        xor %o0, %o0, %o0       ! context_restore_arch returns 0
     107FUNCTION_END(context_restore_arch)
  • kernel/arch/sparc64/src/debug/stacktrace_asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/stack.h>
    3031
    3132.text
    3233
    33 .global frame_pointer_get
    34 .global program_counter_get
    35 .global alloc_window_and_flush
    36 
    37 frame_pointer_get:
     34FUNCTION_BEGIN(frame_pointer_get)
    3835        # Add the stack bias to %sp to get the actual address.
    3936        retl
    4037        add %sp, STACK_BIAS, %o0
     38FUNCTION_END(frame_pointer_get)
    4139
    42 program_counter_get:
     40FUNCTION_BEGIN(program_counter_get)
    4341        retl
    4442        mov %o7, %o0
     43FUNCTION_END(program_counter_get)
    4544
    46 alloc_window_and_flush:
     45FUNCTION_BEGIN(alloc_window_and_flush)
    4746        save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp
    4847        # Flush all other windows to memory so that we can read their contents.
     
    5049        ret
    5150        restore
     51FUNCTION_END(alloc_window_and_flush)
    5252
  • kernel/arch/sparc64/src/dummy.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global calibrate_delay_loop
    32 .global asm_delay_loop
    33 .global cpu_sleep
    34 .global dummy
     33FUNCTION_BEGIN(cpu_sleep)
     34        retl
     35        nop
     36FUNCTION_END(cpu_sleep)
    3537
    36 calibrate_delay_loop:
    37 asm_delay_loop:
    38 cpu_sleep:
     38FUNCTION_BEGIN(cpu_halt)
     39        ba %xcc, cpu_halt
     40        nop
     41FUNCTION_END(cpu_halt)
    3942
    40 dummy:
    41         br.ret.sptk.many b0
    42 
  • kernel/arch/sparc64/src/sun4u/asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/arch.h>
    3031#include <arch/stack.h>
     
    5556.endm
    5657
    57 .global write_to_ag_g6
    58 write_to_ag_g6:
     58FUNCTION_BEGIN(write_to_ag_g6)
    5959        WRITE_ALTERNATE_REGISTER %g6, PSTATE_AG_BIT
     60FUNCTION_END(write_to_ag_g6)
    6061
    61 .global write_to_ag_g7
    62 write_to_ag_g7:
     62FUNCTION_BEGIN(write_to_ag_g7)
    6363        WRITE_ALTERNATE_REGISTER %g7, PSTATE_AG_BIT
     64FUNCTION_END(write_to_ag_g7)
    6465
    65 .global write_to_ig_g6
    66 write_to_ig_g6:
     66FUNCTION_BEGIN(write_to_ig_g6)
    6767        WRITE_ALTERNATE_REGISTER %g6, PSTATE_IG_BIT
     68FUNCTION_END(write_to_ig_g6)
    6869
    69 .global read_from_ag_g6
    70 read_from_ag_g6:
     70FUNCTION_BEGIN(read_from_ag_g6)
    7171        READ_ALTERNATE_REGISTER %g6, PSTATE_AG_BIT
     72FUNCTION_END(read_from_ag_g6)
    7273
    73 .global read_from_ag_g7
    74 read_from_ag_g7:
     74FUNCTION_BEGIN(read_from_ag_g7)
    7575        READ_ALTERNATE_REGISTER %g7, PSTATE_AG_BIT
     76FUNCTION_END(read_from_ag_g7)
    7677
    7778/** Switch to userspace.
     
    8182 * %o2  Userspace address of uarg structure.
    8283 */
    83 .global switch_to_userspace
    84 switch_to_userspace:
     84FUNCTION_BEGIN(switch_to_userspace)
    8585        save %o1, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
    8686        flushw
     
    119119       
    120120        done                            ! jump to userspace
     121FUNCTION_END(switch_to_userspace)
    121122
  • kernel/arch/sparc64/src/sun4u/start.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931#include <arch/arch.h>
    3032#include <arch/cpu.h>
     
    7678 */
    7779
    78 .global kernel_image_start
    79 kernel_image_start:
     80SYMBOL(kernel_image_start)
    8081        mov BSP_FLAG, %l0
    8182        and %o0, %l0, %l7                       ! l7 <= bootstrap processor?
     
    396397
    397398.align 8
    398 .global physmem_base            ! copy of the physical memory base address
    399 physmem_base:
     399SYMBOL(physmem_base)    ! copy of the physical memory base address
    400400        .quad 0
    401401
     
    405405 * are meant to stay together, aligned on a 32B boundary.
    406406 */
    407 .global fast_data_access_mmu_miss_data_hi
    408 .global end_of_identity
    409 .global kernel_8k_tlb_data_template
    410 .global tlb_tag_access_context_mask
    411407
    412408.align 32
     
    414410 * This label is used by the fast_data_access_MMU_miss trap handler.
    415411 */
    416 fast_data_access_mmu_miss_data_hi:
     412SYMBOL(fast_data_access_mmu_miss_data_hi)
    417413/*
    418414 * This variable is used by the fast_data_access_MMU_miss trap handler.
     
    420416 * memory.
    421417 */
    422 end_of_identity:
     418SYMBOL(end_of_identity)
    423419        .quad -1
    424420/*
     
    427423 * physical memory.
    428424 */
    429 kernel_8k_tlb_data_template:
     425SYMBOL(kernel_8k_tlb_data_template)
    430426#ifdef CONFIG_VIRT_IDX_DCACHE
    431427        .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | \
     
    440436 * It allows us to save one precious instruction slot of this handler.
    441437 */
    442 tlb_tag_access_context_mask:
     438SYMBOL(tlb_tag_access_context_mask)
    443439        .quad TLB_TAG_ACCESS_CONTEXT_MASK
    444440
  • kernel/arch/sparc64/src/sun4v/asm.S

    r6adb775f r32573ff  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/mm/mmu.h>
    3031#include <arch/regdef.h>
     
    3940 * %o2  Userspace address of uarg structure.
    4041 */
    41 .global switch_to_userspace
    42 switch_to_userspace:
     42FUNCTION_BEGIN(switch_to_userspace)
    4343        save %o1, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp
    4444        flushw
     
    7575        wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate
    7676        done                            ! jump to userspace
     77FUNCTION_END(switch_to_userspace)
  • kernel/arch/sparc64/src/sun4v/start.S

    r6adb775f r32573ff  
    2828#
    2929
     30#include <abi/asmtool.h>
    3031#include <arch/arch.h>
    3132#include <arch/stack.h>
     
    106107 *
    107108 */
    108 .global kernel_image_start
    109 kernel_image_start:
     109SYMBOL(kernel_image_start)
    110110        mov BSP_FLAG, %l0
    111111        and %o0, %l0, %l7                       ! l7 <= bootstrap processor?
     
    310310
    311311.align 8
    312 .global temp_cpu_mondo_handler
    313 temp_cpu_mondo_handler:
     312SYMBOL(temp_cpu_mondo_handler)
    314313
    315314        set 0x3c, %o0
     
    341340
    342341.align 8
    343 .global physmem_base            ! copy of the physical memory base address
    344 physmem_base:
     342SYMBOL(physmem_base)    ! copy of the physical memory base address
    345343        .quad 0
    346344
     
    350348 * memory.
    351349 */
    352 .global end_of_identity
    353 end_of_identity:
     350SYMBOL(end_of_identity)
    354351        .quad -1
    355352
    356 .global kernel_8k_tlb_data_template
    357 kernel_8k_tlb_data_template:
     353SYMBOL(kernel_8k_tlb_data_template)
    358354        .quad 0
    359355
    360356/* MMU fault status areas for all CPUs */
    361357.align MMU_FSA_ALIGNMENT
    362 .global mmu_fsas
    363 mmu_fsas:
     358SYMBOL(mmu_fsas)
    364359        .space (MMU_FSA_SIZE * MAX_NUM_STRANDS)
  • kernel/arch/sparc64/src/trap/sun4u/trap_table.S

    r6adb775f r32573ff  
    3737.text
    3838
     39#include <abi/asmtool.h>
    3940#include <arch/trap/trap_table.h>
    4041#include <arch/trap/regwin.h>
     
    5556 */
    5657.align TABLE_SIZE
    57 .global trap_table
    58 trap_table:
     58SYMBOL(trap_table)
    5959
    6060/* TT = 0x08, TL = 0, instruction_access_exception */
    6161.org trap_table + TT_INSTRUCTION_ACCESS_EXCEPTION*ENTRY_SIZE
    62 .global instruction_access_exception_tl0
    63 instruction_access_exception_tl0:
     62SYMBOL(instruction_access_exception_tl0)
    6463        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
    6564        mov TT_INSTRUCTION_ACCESS_EXCEPTION, %g2
     
    6968/* TT = 0x0a, TL = 0, instruction_access_error */
    7069.org trap_table + TT_INSTRUCTION_ACCESS_ERROR*ENTRY_SIZE
    71 .global instruction_access_error_tl0
    72 instruction_access_error_tl0:
     70SYMBOL(instruction_access_error_tl0)
    7371        mov TT_INSTRUCTION_ACCESS_ERROR, %g2
    7472        clr %g5
     
    7775/* TT = 0x10, TL = 0, illegal_instruction */
    7876.org trap_table + TT_ILLEGAL_INSTRUCTION*ENTRY_SIZE
    79 .global illegal_instruction_tl0
    80 illegal_instruction_tl0:
     77SYMBOL(illegal_instruction_tl0)
    8178        mov TT_ILLEGAL_INSTRUCTION, %g2
    8279        clr %g5
     
    8582/* TT = 0x11, TL = 0, privileged_opcode */
    8683.org trap_table + TT_PRIVILEGED_OPCODE*ENTRY_SIZE
    87 .global privileged_opcode_tl0
    88 privileged_opcode_tl0:
     84SYMBOL(privileged_opcode_tl0)
    8985        mov TT_PRIVILEGED_OPCODE, %g2
    9086        clr %g5
     
    9389/* TT = 0x12, TL = 0, unimplemented_LDD */
    9490.org trap_table + TT_UNIMPLEMENTED_LDD*ENTRY_SIZE
    95 .global unimplemented_LDD_tl0
    96 unimplemented_LDD_tl0:
     91SYMBOL(unimplemented_LDD_tl0)
    9792        mov TT_UNIMPLEMENTED_LDD, %g2
    9893        clr %g5
     
    10196/* TT = 0x13, TL = 0, unimplemented_STD */
    10297.org trap_table + TT_UNIMPLEMENTED_STD*ENTRY_SIZE
    103 .global unimplemented_STD_tl0
    104 unimplemented_STD_tl0:
     98SYMBOL(unimplemented_STD_tl0)
    10599        mov TT_UNIMPLEMENTED_STD, %g2
    106100        clr %g5
     
    109103/* TT = 0x20, TL = 0, fb_disabled handler */
    110104.org trap_table + TT_FP_DISABLED*ENTRY_SIZE
    111 .global fb_disabled_tl0
    112 fp_disabled_tl0:
     105SYMBOL(fp_disabled_tl0)
    113106        mov TT_FP_DISABLED, %g2
    114107        clr %g5
     
    117110/* TT = 0x21, TL = 0, fb_exception_ieee_754 handler */
    118111.org trap_table + TT_FP_EXCEPTION_IEEE_754*ENTRY_SIZE
    119 .global fb_exception_ieee_754_tl0
    120 fp_exception_ieee_754_tl0:
     112SYMBOL(fp_exception_ieee_754_tl0)
    121113        mov TT_FP_EXCEPTION_IEEE_754, %g2
    122114        clr %g5
     
    125117/* TT = 0x22, TL = 0, fb_exception_other handler */
    126118.org trap_table + TT_FP_EXCEPTION_OTHER*ENTRY_SIZE
    127 .global fb_exception_other_tl0
    128 fp_exception_other_tl0:
     119SYMBOL(fp_exception_other_tl0)
    129120        mov TT_FP_EXCEPTION_OTHER, %g2
    130121        clr %g5
     
    133124/* TT = 0x23, TL = 0, tag_overflow */
    134125.org trap_table + TT_TAG_OVERFLOW*ENTRY_SIZE
    135 .global tag_overflow_tl0
    136 tag_overflow_tl0:
     126SYMBOL(tag_overflow_tl0)
    137127        mov TT_TAG_OVERFLOW, %g2
    138128        clr %g5
     
    141131/* TT = 0x24, TL = 0, clean_window handler */
    142132.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
    143 .global clean_window_tl0
    144 clean_window_tl0:
     133SYMBOL(clean_window_tl0)
    145134        CLEAN_WINDOW_HANDLER
    146135
    147136/* TT = 0x28, TL = 0, division_by_zero */
    148137.org trap_table + TT_DIVISION_BY_ZERO*ENTRY_SIZE
    149 .global division_by_zero_tl0
    150 division_by_zero_tl0:
     138SYMBOL(division_by_zero_tl0)
    151139        mov TT_DIVISION_BY_ZERO, %g2
    152140        clr %g5
     
    155143/* TT = 0x30, TL = 0, data_access_exception */
    156144.org trap_table + TT_DATA_ACCESS_EXCEPTION*ENTRY_SIZE
    157 .global data_access_exception_tl0
    158 data_access_exception_tl0:
     145SYMBOL(data_access_exception_tl0)
    159146        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
    160147        mov TT_DATA_ACCESS_EXCEPTION, %g2
     
    164151/* TT = 0x32, TL = 0, data_access_error */
    165152.org trap_table + TT_DATA_ACCESS_ERROR*ENTRY_SIZE
    166 .global data_access_error_tl0
    167 data_access_error_tl0:
     153SYMBOL(data_access_error_tl0)
    168154        mov TT_DATA_ACCESS_ERROR, %g2
    169155        clr %g5
     
    172158/* TT = 0x34, TL = 0, mem_address_not_aligned */
    173159.org trap_table + TT_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    174 .global mem_address_not_aligned_tl0
    175 mem_address_not_aligned_tl0:
     160SYMBOL(mem_address_not_aligned_tl0)
    176161        mov TT_MEM_ADDRESS_NOT_ALIGNED, %g2
    177162        clr %g5
     
    180165/* TT = 0x35, TL = 0, LDDF_mem_address_not_aligned */
    181166.org trap_table + TT_LDDF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    182 .global LDDF_mem_address_not_aligned_tl0
    183 LDDF_mem_address_not_aligned_tl0:
     167SYMBOL(LDDF_mem_address_not_aligned_tl0)
    184168        mov TT_LDDF_MEM_ADDRESS_NOT_ALIGNED, %g2
    185169        clr %g5
     
    188172/* TT = 0x36, TL = 0, STDF_mem_address_not_aligned */
    189173.org trap_table + TT_STDF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    190 .global STDF_mem_address_not_aligned_tl0
    191 STDF_mem_address_not_aligned_tl0:
     174SYMBOL(STDF_mem_address_not_aligned_tl0)
    192175        mov TT_STDF_MEM_ADDRESS_NOT_ALIGNED, %g2
    193176        clr %g5
     
    196179/* TT = 0x37, TL = 0, privileged_action */
    197180.org trap_table + TT_PRIVILEGED_ACTION*ENTRY_SIZE
    198 .global privileged_action_tl0
    199 privileged_action_tl0:
     181SYMBOL(privileged_action_tl0)
    200182        mov TT_PRIVILEGED_ACTION, %g2
    201183        clr %g5
     
    204186/* TT = 0x38, TL = 0, LDQF_mem_address_not_aligned */
    205187.org trap_table + TT_LDQF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    206 .global LDQF_mem_address_not_aligned_tl0
    207 LDQF_mem_address_not_aligned_tl0:
     188SYMBOL(LDQF_mem_address_not_aligned_tl0)
    208189        mov TT_LDQF_MEM_ADDRESS_NOT_ALIGNED, %g2
    209190        clr %g5
     
    212193/* TT = 0x39, TL = 0, STQF_mem_address_not_aligned */
    213194.org trap_table + TT_STQF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    214 .global STQF_mem_address_not_aligned_tl0
    215 STQF_mem_address_not_aligned_tl0:
     195SYMBOL(STQF_mem_address_not_aligned_tl0)
    216196        mov TT_STQF_MEM_ADDRESS_NOT_ALIGNED, %g2
    217197        clr %g5
     
    220200/* TT = 0x41, TL = 0, interrupt_level_1 handler */
    221201.org trap_table + TT_INTERRUPT_LEVEL_1*ENTRY_SIZE
    222 .global interrupt_level_1_handler_tl0
    223 interrupt_level_1_handler_tl0:
     202SYMBOL(interrupt_level_1_handler_tl0)
    224203        mov TT_INTERRUPT_LEVEL_1, %g2
    225204        clr %g5
     
    228207/* TT = 0x42, TL = 0, interrupt_level_2 handler */
    229208.org trap_table + TT_INTERRUPT_LEVEL_2*ENTRY_SIZE
    230 .global interrupt_level_2_handler_tl0
    231 interrupt_level_2_handler_tl0:
     209SYMBOL(interrupt_level_2_handler_tl0)
    232210        mov TT_INTERRUPT_LEVEL_2, %g2
    233211        clr %g5
     
    236214/* TT = 0x43, TL = 0, interrupt_level_3 handler */
    237215.org trap_table + TT_INTERRUPT_LEVEL_3*ENTRY_SIZE
    238 .global interrupt_level_3_handler_tl0
    239 interrupt_level_3_handler_tl0:
     216SYMBOL(interrupt_level_3_handler_tl0)
    240217        mov TT_INTERRUPT_LEVEL_3, %g2
    241218        clr %g5
     
    244221/* TT = 0x44, TL = 0, interrupt_level_4 handler */
    245222.org trap_table + TT_INTERRUPT_LEVEL_4*ENTRY_SIZE
    246 .global interrupt_level_4_handler_tl0
    247 interrupt_level_4_handler_tl0:
     223SYMBOL(interrupt_level_4_handler_tl0)
    248224        mov TT_INTERRUPT_LEVEL_4, %g2
    249225        clr %g5
     
    252228/* TT = 0x45, TL = 0, interrupt_level_5 handler */
    253229.org trap_table + TT_INTERRUPT_LEVEL_5*ENTRY_SIZE
    254 .global interrupt_level_5_handler_tl0
    255 interrupt_level_5_handler_tl0:
     230SYMBOL(interrupt_level_5_handler_tl0)
    256231        mov TT_INTERRUPT_LEVEL_5, %g2
    257232        clr %g5
     
    260235/* TT = 0x46, TL = 0, interrupt_level_6 handler */
    261236.org trap_table + TT_INTERRUPT_LEVEL_6*ENTRY_SIZE
    262 .global interrupt_level_6_handler_tl0
    263 interrupt_level_6_handler_tl0:
     237SYMBOL(interrupt_level_6_handler_tl0)
    264238        mov TT_INTERRUPT_LEVEL_6, %g2
    265239        clr %g5
     
    268242/* TT = 0x47, TL = 0, interrupt_level_7 handler */
    269243.org trap_table + TT_INTERRUPT_LEVEL_7*ENTRY_SIZE
    270 .global interrupt_level_7_handler_tl0
    271 interrupt_level_7_handler_tl0:
     244SYMBOL(interrupt_level_7_handler_tl0)
    272245        mov TT_INTERRUPT_LEVEL_7, %g2
    273246        clr %g5
     
    276249/* TT = 0x48, TL = 0, interrupt_level_8 handler */
    277250.org trap_table + TT_INTERRUPT_LEVEL_8*ENTRY_SIZE
    278 .global interrupt_level_8_handler_tl0
    279 interrupt_level_8_handler_tl0:
     251SYMBOL(interrupt_level_8_handler_tl0)
    280252        mov TT_INTERRUPT_LEVEL_8, %g2
    281253        clr %g5
     
    284256/* TT = 0x49, TL = 0, interrupt_level_9 handler */
    285257.org trap_table + TT_INTERRUPT_LEVEL_9*ENTRY_SIZE
    286 .global interrupt_level_9_handler_tl0
    287 interrupt_level_9_handler_tl0:
     258SYMBOL(interrupt_level_9_handler_tl0)
    288259        mov TT_INTERRUPT_LEVEL_9, %g2
    289260        clr %g5
     
    292263/* TT = 0x4a, TL = 0, interrupt_level_10 handler */
    293264.org trap_table + TT_INTERRUPT_LEVEL_10*ENTRY_SIZE
    294 .global interrupt_level_10_handler_tl0
    295 interrupt_level_10_handler_tl0:
     265SYMBOL(interrupt_level_10_handler_tl0)
    296266        mov TT_INTERRUPT_LEVEL_10, %g2
    297267        clr %g5
     
    300270/* TT = 0x4b, TL = 0, interrupt_level_11 handler */
    301271.org trap_table + TT_INTERRUPT_LEVEL_11*ENTRY_SIZE
    302 .global interrupt_level_11_handler_tl0
    303 interrupt_level_11_handler_tl0:
     272SYMBOL(interrupt_level_11_handler_tl0)
    304273        mov TT_INTERRUPT_LEVEL_11, %g2
    305274        clr %g5
     
    308277/* TT = 0x4c, TL = 0, interrupt_level_12 handler */
    309278.org trap_table + TT_INTERRUPT_LEVEL_12*ENTRY_SIZE
    310 .global interrupt_level_12_handler_tl0
    311 interrupt_level_12_handler_tl0:
     279SYMBOL(interrupt_level_12_handler_tl0)
    312280        mov TT_INTERRUPT_LEVEL_12, %g2
    313281        clr %g5
     
    316284/* TT = 0x4d, TL = 0, interrupt_level_13 handler */
    317285.org trap_table + TT_INTERRUPT_LEVEL_13*ENTRY_SIZE
    318 .global interrupt_level_13_handler_tl0
    319 interrupt_level_13_handler_tl0:
     286SYMBOL(interrupt_level_13_handler_tl0)
    320287        mov TT_INTERRUPT_LEVEL_13, %g2
    321288        clr %g5
     
    324291/* TT = 0x4e, TL = 0, interrupt_level_14 handler */
    325292.org trap_table + TT_INTERRUPT_LEVEL_14*ENTRY_SIZE
    326 .global interrupt_level_14_handler_tl0
    327 interrupt_level_14_handler_tl0:
     293SYMBOL(interrupt_level_14_handler_tl0)
    328294        mov TT_INTERRUPT_LEVEL_14, %g2
    329295        clr %g5
     
    332298/* TT = 0x4f, TL = 0, interrupt_level_15 handler */
    333299.org trap_table + TT_INTERRUPT_LEVEL_15*ENTRY_SIZE
    334 .global interrupt_level_15_handler_tl0
    335 interrupt_level_15_handler_tl0:
     300SYMBOL(interrupt_level_15_handler_tl0)
    336301        mov TT_INTERRUPT_LEVEL_15, %g2
    337302        clr %g5
     
    340305/* TT = 0x60, TL = 0, interrupt_vector_trap handler */
    341306.org trap_table + TT_INTERRUPT_VECTOR_TRAP*ENTRY_SIZE
    342 .global interrupt_vector_trap_handler_tl0
    343 interrupt_vector_trap_handler_tl0:
     307SYMBOL(interrupt_vector_trap_handler_tl0)
    344308        mov TT_INTERRUPT_VECTOR_TRAP, %g2
    345309        clr %g5
     
    348312/* TT = 0x64, TL = 0, fast_instruction_access_MMU_miss */
    349313.org trap_table + TT_FAST_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE
    350 .global fast_instruction_access_mmu_miss_handler_tl0
    351 fast_instruction_access_mmu_miss_handler_tl0:
     314SYMBOL(fast_instruction_access_mmu_miss_handler_tl0)
    352315        FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
    353316
    354317/* TT = 0x68, TL = 0, fast_data_access_MMU_miss */
    355318.org trap_table + TT_FAST_DATA_ACCESS_MMU_MISS*ENTRY_SIZE
    356 .global fast_data_access_mmu_miss_handler_tl0
    357 fast_data_access_mmu_miss_handler_tl0:
     319SYMBOL(fast_data_access_mmu_miss_handler_tl0)
    358320        FAST_DATA_ACCESS_MMU_MISS_HANDLER 0
    359321
    360322/* TT = 0x6c, TL = 0, fast_data_access_protection */
    361323.org trap_table + TT_FAST_DATA_ACCESS_PROTECTION*ENTRY_SIZE
    362 .global fast_data_access_protection_handler_tl0
    363 fast_data_access_protection_handler_tl0:
     324SYMBOL(fast_data_access_protection_handler_tl0)
    364325        FAST_DATA_ACCESS_PROTECTION_HANDLER 0
    365326
    366327/* TT = 0x80, TL = 0, spill_0_normal handler */
    367328.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
    368 .global spill_0_normal_tl0
    369 spill_0_normal_tl0:
     329SYMBOL(spill_0_normal_tl0)
    370330        SPILL_NORMAL_HANDLER_KERNEL
    371331
    372332/* TT = 0x84, TL = 0, spill_1_normal handler */
    373333.org trap_table + TT_SPILL_1_NORMAL*ENTRY_SIZE
    374 .global spill_1_normal_tl0
    375 spill_1_normal_tl0:
     334SYMBOL(spill_1_normal_tl0)
    376335        SPILL_NORMAL_HANDLER_USERSPACE
    377336
    378337/* TT = 0x88, TL = 0, spill_2_normal handler */
    379338.org trap_table + TT_SPILL_2_NORMAL*ENTRY_SIZE
    380 .global spill_2_normal_tl0
    381 spill_2_normal_tl0:
     339SYMBOL(spill_2_normal_tl0)
    382340        SPILL_TO_USPACE_WINDOW_BUFFER
    383341
    384342/* TT = 0xa0, TL = 0, spill_0_other handler */
    385343.org trap_table + TT_SPILL_0_OTHER*ENTRY_SIZE
    386 .global spill_0_other_tl0
    387 spill_0_other_tl0:
     344SYMBOL(spill_0_other_tl0)
    388345        SPILL_TO_USPACE_WINDOW_BUFFER
    389346
    390347/* TT = 0xc0, TL = 0, fill_0_normal handler */
    391348.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
    392 .global fill_0_normal_tl0
    393 fill_0_normal_tl0:
     349SYMBOL(fill_0_normal_tl0)
    394350        FILL_NORMAL_HANDLER_KERNEL
    395351
    396352/* TT = 0xc4, TL = 0, fill_1_normal handler */
    397353.org trap_table + TT_FILL_1_NORMAL*ENTRY_SIZE
    398 .global fill_1_normal_tl0
    399 fill_1_normal_tl0:
     354SYMBOL(fill_1_normal_tl0)
    400355        FILL_NORMAL_HANDLER_USERSPACE
    401356
     
    410365    127
    411366.org trap_table + (TT_TRAP_INSTRUCTION_0+\cur)*ENTRY_SIZE
    412 .global trap_instruction_\cur\()_tl0
    413 trap_instruction_\cur\()_tl0:
     367SYMBOL(trap_instruction_\cur\()_tl0)
    414368        mov \cur, %g2
    415369        ba %xcc, trap_instruction_handler
     
    423377/* TT = 0x08, TL > 0, instruction_access_exception */
    424378.org trap_table + (TT_INSTRUCTION_ACCESS_EXCEPTION+512)*ENTRY_SIZE
    425 .global instruction_access_exception_tl1
    426 instruction_access_exception_tl1:
     379SYMBOL(instruction_access_exception_tl1)
    427380        wrpr %g0, 1, %tl
    428381        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     
    433386/* TT = 0x0a, TL > 0, instruction_access_error */
    434387.org trap_table + (TT_INSTRUCTION_ACCESS_ERROR+512)*ENTRY_SIZE
    435 .global instruction_access_error_tl1
    436 instruction_access_error_tl1:
     388SYMBOL(instruction_access_error_tl1)
    437389        wrpr %g0, 1, %tl
    438390        mov TT_INSTRUCTION_ACCESS_ERROR, %g2
     
    442394/* TT = 0x10, TL > 0, illegal_instruction */
    443395.org trap_table + (TT_ILLEGAL_INSTRUCTION+512)*ENTRY_SIZE
    444 .global illegal_instruction_tl1
    445 illegal_instruction_tl1:
     396SYMBOL(illegal_instruction_tl1)
    446397        wrpr %g0, 1, %tl
    447398        mov TT_ILLEGAL_INSTRUCTION, %g2
     
    451402/* TT = 0x24, TL > 0, clean_window handler */
    452403.org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE
    453 .global clean_window_tl1
    454 clean_window_tl1:
     404SYMBOL(clean_window_tl1)
    455405        CLEAN_WINDOW_HANDLER
    456406
    457407/* TT = 0x28, TL > 0, division_by_zero */
    458408.org trap_table + (TT_DIVISION_BY_ZERO+512)*ENTRY_SIZE
    459 .global division_by_zero_tl1
    460 division_by_zero_tl1:
     409SYMBOL(division_by_zero_tl1)
    461410        wrpr %g0, 1, %tl
    462411        mov TT_DIVISION_BY_ZERO, %g2
     
    466415/* TT = 0x30, TL > 0, data_access_exception */
    467416.org trap_table + (TT_DATA_ACCESS_EXCEPTION+512)*ENTRY_SIZE
    468 .global data_access_exception_tl1
    469 data_access_exception_tl1:
     417SYMBOL(data_access_exception_tl1)
    470418        wrpr %g0, 1, %tl
    471419        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     
    476424/* TT = 0x32, TL > 0, data_access_error */
    477425.org trap_table + (TT_DATA_ACCESS_ERROR+512)*ENTRY_SIZE
    478 .global data_access_error_tl1
    479 data_access_error_tl1:
     426SYMBOL(data_access_error_tl1)
    480427        wrpr %g0, 1, %tl
    481428        mov TT_DATA_ACCESS_ERROR, %g2
     
    485432/* TT = 0x34, TL > 0, mem_address_not_aligned */
    486433.org trap_table + (TT_MEM_ADDRESS_NOT_ALIGNED+512)*ENTRY_SIZE
    487 .global mem_address_not_aligned_tl1
    488 mem_address_not_aligned_tl1:
     434SYMBOL(mem_address_not_aligned_tl1)
    489435        wrpr %g0, 1, %tl
    490436        mov TT_MEM_ADDRESS_NOT_ALIGNED, %g2
     
    494440/* TT = 0x68, TL > 0, fast_data_access_MMU_miss */
    495441.org trap_table + (TT_FAST_DATA_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    496 .global fast_data_access_mmu_miss_handler_tl1
    497 fast_data_access_mmu_miss_handler_tl1:
     442SYMBOL(fast_data_access_mmu_miss_handler_tl1)
    498443        FAST_DATA_ACCESS_MMU_MISS_HANDLER 1
    499444
    500445/* TT = 0x6c, TL > 0, fast_data_access_protection */
    501446.org trap_table + (TT_FAST_DATA_ACCESS_PROTECTION+512)*ENTRY_SIZE
    502 .global fast_data_access_protection_handler_tl1
    503 fast_data_access_protection_handler_tl1:
     447SYMBOL(fast_data_access_protection_handler_tl1)
    504448        FAST_DATA_ACCESS_PROTECTION_HANDLER 1
    505449
    506450/* TT = 0x80, TL > 0, spill_0_normal handler */
    507451.org trap_table + (TT_SPILL_0_NORMAL+512)*ENTRY_SIZE
    508 .global spill_0_normal_tl1
    509 spill_0_normal_tl1:
     452SYMBOL(spill_0_normal_tl1)
    510453        SPILL_NORMAL_HANDLER_KERNEL
    511454
    512455/* TT = 0x88, TL > 0, spill_2_normal handler */
    513456.org trap_table + (TT_SPILL_2_NORMAL+512)*ENTRY_SIZE
    514 .global spill_2_normal_tl1
    515 spill_2_normal_tl1:
     457SYMBOL(spill_2_normal_tl1)
    516458        SPILL_TO_USPACE_WINDOW_BUFFER
    517459
    518460/* TT = 0xa0, TL > 0, spill_0_other handler */
    519461.org trap_table + (TT_SPILL_0_OTHER+512)*ENTRY_SIZE
    520 .global spill_0_other_tl1
    521 spill_0_other_tl1:
     462SYMBOL(spill_0_other_tl1)
    522463        SPILL_TO_USPACE_WINDOW_BUFFER
    523464
    524465/* TT = 0xc0, TL > 0, fill_0_normal handler */
    525466.org trap_table + (TT_FILL_0_NORMAL+512)*ENTRY_SIZE
    526 .global fill_0_normal_tl1
    527 fill_0_normal_tl1:
     467SYMBOL(fill_0_normal_tl1)
    528468        FILL_NORMAL_HANDLER_KERNEL
    529469
     
    914854.endm
    915855
    916 .global preemptible_handler
    917 preemptible_handler:
     856SYMBOL(preemptible_handler)
    918857        PREEMPTIBLE_HANDLER_TEMPLATE 0
    919858
    920 .global trap_instruction_handler
    921 trap_instruction_handler:
     859SYMBOL(trap_instruction_handler)
    922860        PREEMPTIBLE_HANDLER_TEMPLATE 1
  • kernel/arch/sparc64/src/trap/sun4v/mmu.S

    r6adb775f r32573ff  
    3737.text
    3838
     39#include <abi/asmtool.h>
    3940#include <arch/trap/sun4v/mmu.h>
    4041#include <arch/trap/trap_table.h>
     
    4849 *       %g1    virtual address that has caused the miss
    4950 */
    50 .global install_identity_mapping
    51 install_identity_mapping:
    52 
     51SYMBOL(install_identity_mapping)
    5352        /* output registers mustn't be clobbered during the hypercall, SAVE is too risky */
    5453        mov %o0, %g3
  • kernel/arch/sparc64/src/trap/sun4v/trap_table.S

    r6adb775f r32573ff  
    3838.text
    3939
     40#include <abi/asmtool.h>
    4041#include <arch/trap/trap_table.h>
    4142#include <arch/trap/regwin.h>
     
    5859 */
    5960.align TABLE_SIZE
    60 .global trap_table
    61 trap_table:
     61SYMBOL(trap_table)
    6262
    6363/* TT = 0x08, TL = 0, instruction_access_exception */
    6464/* TT = 0x08, TL = 0, IAE_privilege_violation on UltraSPARC T2 */
    6565.org trap_table + TT_INSTRUCTION_ACCESS_EXCEPTION*ENTRY_SIZE
    66 .global instruction_access_exception_tl0
    67 instruction_access_exception_tl0:
     66SYMBOL(instruction_access_exception_tl0)
    6867        mov TT_INSTRUCTION_ACCESS_EXCEPTION, %g2
    6968        clr %g5
     
    7271/* TT = 0x09, TL = 0, instruction_access_mmu_miss */
    7372.org trap_table + TT_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE
    74 .global instruction_access_mmu_miss_handler_tl0
     73SYMBOL(instruction_access_mmu_miss_handler_tl0)
    7574        ba,a %xcc, fast_instruction_access_mmu_miss_handler_tl0
    7675
    7776/* TT = 0x0a, TL = 0, instruction_access_error */
    7877.org trap_table + TT_INSTRUCTION_ACCESS_ERROR*ENTRY_SIZE
    79 .global instruction_access_error_tl0
    80 instruction_access_error_tl0:
     78SYMBOL(instruction_access_error_tl0)
    8179        mov TT_INSTRUCTION_ACCESS_ERROR, %g2
    8280        clr %g5
     
    8583/* TT = 0x0b, TL = 0, IAE_unauth_access */
    8684.org trap_table + TT_IAE_UNAUTH_ACCESS*ENTRY_SIZE
    87 .global iae_unauth_access_tl0
    88 iae_unauth_access_tl0:
     85SYMBOL(iae_unauth_access_tl0)
    8986        mov TT_IAE_UNAUTH_ACCESS, %g2
    9087        clr %g5
     
    9390/* TT = 0x0c, TL = 0, IAE_nfo_page */
    9491.org trap_table + TT_IAE_NFO_PAGE*ENTRY_SIZE
    95 .global iae_nfo_page_tl0
    96 iae_nfo_page_tl0:
     92SYMBOL(iae_nfo_page_tl0)
    9793        mov TT_IAE_NFO_PAGE, %g2
    9894        clr %g5
     
    10197/* TT = 0x10, TL = 0, illegal_instruction */
    10298.org trap_table + TT_ILLEGAL_INSTRUCTION*ENTRY_SIZE
    103 .global illegal_instruction_tl0
    104 illegal_instruction_tl0:
     99SYMBOL(illegal_instruction_tl0)
    105100        mov TT_ILLEGAL_INSTRUCTION, %g2
    106101        clr %g5
     
    109104/* TT = 0x11, TL = 0, privileged_opcode */
    110105.org trap_table + TT_PRIVILEGED_OPCODE*ENTRY_SIZE
    111 .global privileged_opcode_tl0
    112 privileged_opcode_tl0:
     106SYMBOL(privileged_opcode_tl0)
    113107        mov TT_PRIVILEGED_OPCODE, %g2
    114108        clr %g5
     
    117111/* TT = 0x12, TL = 0, unimplemented_LDD */
    118112.org trap_table + TT_UNIMPLEMENTED_LDD*ENTRY_SIZE
    119 .global unimplemented_LDD_tl0
    120 unimplemented_LDD_tl0:
     113SYMBOL(unimplemented_LDD_tl0)
    121114        mov TT_UNIMPLEMENTED_LDD, %g2
    122115        clr %g5
     
    125118/* TT = 0x13, TL = 0, unimplemented_STD */
    126119.org trap_table + TT_UNIMPLEMENTED_STD*ENTRY_SIZE
    127 .global unimplemented_STD_tl0
    128 unimplemented_STD_tl0:
     120SYMBOL(unimplemented_STD_tl0)
    129121        mov TT_UNIMPLEMENTED_STD, %g2
    130122        clr %g5
     
    133125/* TT = 0x14, TL = 0, DAE_invalid_asi */
    134126.org trap_table + TT_DAE_INVALID_ASI*ENTRY_SIZE
    135 .global dae_invalid_asi_tl0
    136 dae_invalid_asi_tl0:
     127SYMBOL(dae_invalid_asi_tl0)
    137128        mov TT_DAE_INVALID_ASI, %g2
    138129        clr %g5
     
    141132/* TT = 0x15, TL = 0, DAE_privilege_violation */
    142133.org trap_table + TT_DAE_PRIVILEGE_VIOLATION*ENTRY_SIZE
    143 .global dae_privilege_violation_tl0
    144 dae_privilege_violation_tl0:
     134SYMBOL(dae_privilege_violation_tl0)
    145135        mov TT_DAE_PRIVILEGE_VIOLATION, %g2
    146136        clr %g5
     
    149139/* TT = 0x16, TL = 0, DAE_nc_page */
    150140.org trap_table + TT_DAE_NC_PAGE*ENTRY_SIZE
    151 .global dae_nc_page_tl0
    152 dae_nc_page_tl0:
     141SYMBOL(dae_nc_page_tl0)
    153142        mov TT_DAE_NC_PAGE, %g2
    154143        clr %g5
     
    157146/* TT = 0x17, TL = 0, DAE_nfo_page */
    158147.org trap_table + TT_DAE_NFO_PAGE*ENTRY_SIZE
    159 .global dae_nfo_page_tl0
    160 dae_nfo_page_tl0:
     148SYMBOL(dae_nfo_page_tl0)
    161149        mov TT_DAE_NFO_PAGE, %g2
    162150        clr %g5
     
    165153/* TT = 0x20, TL = 0, fb_disabled handler */
    166154.org trap_table + TT_FP_DISABLED*ENTRY_SIZE
    167 .global fb_disabled_tl0
    168 fp_disabled_tl0:
     155SYMBOL(fp_disabled_tl0)
    169156        mov TT_FP_DISABLED, %g2
    170157        clr %g5
     
    173160/* TT = 0x21, TL = 0, fb_exception_ieee_754 handler */
    174161.org trap_table + TT_FP_EXCEPTION_IEEE_754*ENTRY_SIZE
    175 .global fb_exception_ieee_754_tl0
    176 fp_exception_ieee_754_tl0:
     162SYMBOL(fp_exception_ieee_754_tl0)
    177163        mov TT_FP_EXCEPTION_IEEE_754, %g2
    178164        clr %g5
     
    181167/* TT = 0x22, TL = 0, fb_exception_other handler */
    182168.org trap_table + TT_FP_EXCEPTION_OTHER*ENTRY_SIZE
    183 .global fb_exception_other_tl0
    184 fp_exception_other_tl0:
     169SYMBOL(fp_exception_other_tl)
    185170        mov TT_FP_EXCEPTION_OTHER, %g2
    186171        clr %g5
     
    189174/* TT = 0x23, TL = 0, tag_overflow */
    190175.org trap_table + TT_TAG_OVERFLOW*ENTRY_SIZE
    191 .global tag_overflow_tl0
    192 tag_overflow_tl0:
     176SYMBOL(tag_overflow_tl0)
    193177        mov TT_TAG_OVERFLOW, %g2
    194178        clr %g5
     
    197181/* TT = 0x24, TL = 0, clean_window handler */
    198182.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
    199 .global clean_window_tl0
    200 clean_window_tl0:
     183SYMBOL(clean_window_tl0)
    201184        CLEAN_WINDOW_HANDLER
    202185
    203186/* TT = 0x28, TL = 0, division_by_zero */
    204187.org trap_table + TT_DIVISION_BY_ZERO*ENTRY_SIZE
    205 .global division_by_zero_tl0
    206 division_by_zero_tl0:
     188SYMBOL(division_by_zero_tl0)
    207189        mov TT_DIVISION_BY_ZERO, %g2
    208190        clr %g5
     
    212194/* TT = 0x30, TL = 0, DAE_side_effect_page for UltraPSARC T2 */
    213195.org trap_table + TT_DATA_ACCESS_EXCEPTION*ENTRY_SIZE
    214 .global data_access_exception_tl0
    215 data_access_exception_tl0:
     196SYMBOL(data_access_exception_tl0)
    216197        mov TT_DATA_ACCESS_EXCEPTION, %g2
    217198        clr %g5
     
    220201/* TT = 0x31, TL = 0, data_access_mmu_miss */
    221202.org trap_table + TT_DATA_ACCESS_MMU_MISS*ENTRY_SIZE
    222 .global data_access_mmu_miss_tl0
    223 data_access_mmu_miss_tl0:
     203SYMBOL(data_access_mmu_miss_tl0)
    224204        ba,a %xcc, fast_data_access_mmu_miss_handler_tl0
    225205
    226206/* TT = 0x32, TL = 0, data_access_error */
    227207.org trap_table + TT_DATA_ACCESS_ERROR*ENTRY_SIZE
    228 .global data_access_error_tl0
    229 data_access_error_tl0:
     208SYMBOL(data_access_error_tl0)
    230209        mov TT_DATA_ACCESS_ERROR, %g2
    231210        clr %g5
     
    234213/* TT = 0x34, TL = 0, mem_address_not_aligned */
    235214.org trap_table + TT_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    236 .global mem_address_not_aligned_tl0
    237 mem_address_not_aligned_tl0:
     215SYMBOL(mem_address_not_aligned_tl0)
    238216        mov TT_MEM_ADDRESS_NOT_ALIGNED, %g2
    239217        clr %g5
     
    242220/* TT = 0x35, TL = 0, LDDF_mem_address_not_aligned */
    243221.org trap_table + TT_LDDF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    244 .global LDDF_mem_address_not_aligned_tl0
    245 LDDF_mem_address_not_aligned_tl0:
     222SYMBOL(LDDF_mem_address_not_aligned_tl0)
    246223        mov TT_LDDF_MEM_ADDRESS_NOT_ALIGNED, %g2
    247224        clr %g5
     
    250227/* TT = 0x36, TL = 0, STDF_mem_address_not_aligned */
    251228.org trap_table + TT_STDF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    252 .global STDF_mem_address_not_aligned_tl0
    253 STDF_mem_address_not_aligned_tl0:
     229SYMBOL(STDF_mem_address_not_aligned_tl0)
    254230        mov TT_STDF_MEM_ADDRESS_NOT_ALIGNED, %g2
    255231        clr %g5
     
    258234/* TT = 0x37, TL = 0, privileged_action */
    259235.org trap_table + TT_PRIVILEGED_ACTION*ENTRY_SIZE
    260 .global privileged_action_tl0
    261 privileged_action_tl0:
     236SYMBOL(privileged_action_tl0)
    262237        mov TT_PRIVILEGED_ACTION, %g2
    263238        clr %g5
     
    266241/* TT = 0x38, TL = 0, LDQF_mem_address_not_aligned */
    267242.org trap_table + TT_LDQF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    268 .global LDQF_mem_address_not_aligned_tl0
    269 LDQF_mem_address_not_aligned_tl0:
     243SYMBOL(LDQF_mem_address_not_aligned_tl0)
    270244        mov TT_LDQF_MEM_ADDRESS_NOT_ALIGNED, %g2
    271245        clr %g5
     
    274248/* TT = 0x39, TL = 0, STQF_mem_address_not_aligned */
    275249.org trap_table + TT_STQF_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    276 .global STQF_mem_address_not_aligned_tl0
    277 STQF_mem_address_not_aligned_tl0:
     250SYMBOL(STQF_mem_address_not_aligned_tl0)
    278251        mov TT_STQF_MEM_ADDRESS_NOT_ALIGNED, %g2
    279252        clr %g5
     
    282255/* TT = 0x41, TL = 0, interrupt_level_1 handler */
    283256.org trap_table + TT_INTERRUPT_LEVEL_1*ENTRY_SIZE
    284 .global interrupt_level_1_handler_tl0
    285 interrupt_level_1_handler_tl0:
     257SYMBOL(interrupt_level_1_handler_tl0)
    286258        mov TT_INTERRUPT_LEVEL_1, %g2
    287259        clr %g5
     
    290262/* TT = 0x42, TL = 0, interrupt_level_2 handler */
    291263.org trap_table + TT_INTERRUPT_LEVEL_2*ENTRY_SIZE
    292 .global interrupt_level_2_handler_tl0
    293 interrupt_level_2_handler_tl0:
     264SYMBOL(interrupt_level_2_handler_tl0)
    294265        mov TT_INTERRUPT_LEVEL_2, %g2
    295266        clr %g5
     
    298269/* TT = 0x43, TL = 0, interrupt_level_3 handler */
    299270.org trap_table + TT_INTERRUPT_LEVEL_3*ENTRY_SIZE
    300 .global interrupt_level_3_handler_tl0
    301 interrupt_level_3_handler_tl0:
     271SYMBOL(interrupt_level_3_handler_tl0)
    302272        mov TT_INTERRUPT_LEVEL_3, %g2
    303273        clr %g5
     
    306276/* TT = 0x44, TL = 0, interrupt_level_4 handler */
    307277.org trap_table + TT_INTERRUPT_LEVEL_4*ENTRY_SIZE
    308 .global interrupt_level_4_handler_tl0
    309 interrupt_level_4_handler_tl0:
     278SYMBOL(interrupt_level_4_handler_tl0)
    310279        mov TT_INTERRUPT_LEVEL_4, %g2
    311280        clr %g5
     
    314283/* TT = 0x45, TL = 0, interrupt_level_5 handler */
    315284.org trap_table + TT_INTERRUPT_LEVEL_5*ENTRY_SIZE
    316 .global interrupt_level_5_handler_tl0
    317 interrupt_level_5_handler_tl0:
     285SYMBOL(interrupt_level_5_handler_tl0)
    318286        mov TT_INTERRUPT_LEVEL_5, %g2
    319287        clr %g5
     
    322290/* TT = 0x46, TL = 0, interrupt_level_6 handler */
    323291.org trap_table + TT_INTERRUPT_LEVEL_6*ENTRY_SIZE
    324 .global interrupt_level_6_handler_tl0
    325 interrupt_level_6_handler_tl0:
     292SYMBOL(interrupt_level_6_handler_tl0)
    326293        mov TT_INTERRUPT_LEVEL_6, %g2
    327294        clr %g5
     
    330297/* TT = 0x47, TL = 0, interrupt_level_7 handler */
    331298.org trap_table + TT_INTERRUPT_LEVEL_7*ENTRY_SIZE
    332 .global interrupt_level_7_handler_tl0
    333 interrupt_level_7_handler_tl0:
     299SYMBOL(interrupt_level_7_handler_tl0)
    334300        mov TT_INTERRUPT_LEVEL_7, %g2
    335301        clr %g5
     
    338304/* TT = 0x48, TL = 0, interrupt_level_8 handler */
    339305.org trap_table + TT_INTERRUPT_LEVEL_8*ENTRY_SIZE
    340 .global interrupt_level_8_handler_tl0
    341 interrupt_level_8_handler_tl0:
     306SYMBOL(interrupt_level_8_handler_tl0)
    342307        mov TT_INTERRUPT_LEVEL_8, %g2
    343308        clr %g5
     
    346311/* TT = 0x49, TL = 0, interrupt_level_9 handler */
    347312.org trap_table + TT_INTERRUPT_LEVEL_9*ENTRY_SIZE
    348 .global interrupt_level_9_handler_tl0
    349 interrupt_level_9_handler_tl0:
     313SYMBOL(interrupt_level_9_handler_tl0)
    350314        mov TT_INTERRUPT_LEVEL_9, %g2
    351315        clr %g5
     
    354318/* TT = 0x4a, TL = 0, interrupt_level_10 handler */
    355319.org trap_table + TT_INTERRUPT_LEVEL_10*ENTRY_SIZE
    356 .global interrupt_level_10_handler_tl0
    357 interrupt_level_10_handler_tl0:
     320SYMBOL(interrupt_level_10_handler_tl0)
    358321        mov TT_INTERRUPT_LEVEL_10, %g2
    359322        clr %g5
     
    362325/* TT = 0x4b, TL = 0, interrupt_level_11 handler */
    363326.org trap_table + TT_INTERRUPT_LEVEL_11*ENTRY_SIZE
    364 .global interrupt_level_11_handler_tl0
    365 interrupt_level_11_handler_tl0:
     327SYMBOL(interrupt_level_11_handler_tl0)
    366328        mov TT_INTERRUPT_LEVEL_11, %g2
    367329        clr %g5
     
    370332/* TT = 0x4c, TL = 0, interrupt_level_12 handler */
    371333.org trap_table + TT_INTERRUPT_LEVEL_12*ENTRY_SIZE
    372 .global interrupt_level_12_handler_tl0
    373 interrupt_level_12_handler_tl0:
     334SYMBOL(interrupt_level_12_handler_tl0)
    374335        mov TT_INTERRUPT_LEVEL_12, %g2
    375336        clr %g5
     
    378339/* TT = 0x4d, TL = 0, interrupt_level_13 handler */
    379340.org trap_table + TT_INTERRUPT_LEVEL_13*ENTRY_SIZE
    380 .global interrupt_level_13_handler_tl0
    381 interrupt_level_13_handler_tl0:
     341SYMBOL(interrupt_level_13_handler_tl0)
    382342        mov TT_INTERRUPT_LEVEL_13, %g2
    383343        clr %g5
     
    386346/* TT = 0x4e, TL = 0, interrupt_level_14 handler */
    387347.org trap_table + TT_INTERRUPT_LEVEL_14*ENTRY_SIZE
    388 .global interrupt_level_14_handler_tl0
    389 interrupt_level_14_handler_tl0:
     348SYMBOL(interrupt_level_14_handler_tl0)
    390349        mov TT_INTERRUPT_LEVEL_14, %g2
    391350        clr %g5
     
    394353/* TT = 0x4f, TL = 0, interrupt_level_15 handler */
    395354.org trap_table + TT_INTERRUPT_LEVEL_15*ENTRY_SIZE
    396 .global interrupt_level_15_handler_tl0
    397 interrupt_level_15_handler_tl0:
     355SYMBOL(interrupt_level_15_handler_tl0)
    398356        mov TT_INTERRUPT_LEVEL_15, %g2
    399357        clr %g5
     
    402360/* TT = 0x64, TL = 0, fast_instruction_access_MMU_miss */
    403361.org trap_table + TT_FAST_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE
    404 .global fast_instruction_access_mmu_miss_handler_tl0
    405 fast_instruction_access_mmu_miss_handler_tl0:
     362SYMBOL(fast_instruction_access_mmu_miss_handler_tl0)
    406363        FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
    407364
    408365/* TT = 0x68, TL = 0, fast_data_access_MMU_miss */
    409366.org trap_table + TT_FAST_DATA_ACCESS_MMU_MISS*ENTRY_SIZE
    410 .global fast_data_access_mmu_miss_handler_tl0
    411 fast_data_access_mmu_miss_handler_tl0:
     367SYMBOL(fast_data_access_mmu_miss_handler_tl0)
    412368        FAST_DATA_ACCESS_MMU_MISS_HANDLER 0
    413369
    414370/* TT = 0x6c, TL = 0, fast_data_access_protection */
    415371.org trap_table + TT_FAST_DATA_ACCESS_PROTECTION*ENTRY_SIZE
    416 .global fast_data_access_protection_handler_tl0
    417 fast_data_access_protection_handler_tl0:
     372SYMBOL(fast_data_access_protection_handler_tl0)
    418373        FAST_DATA_ACCESS_PROTECTION_HANDLER 0
    419374
    420375/* TT = 0x7c, TL = 0, cpu_mondo */
    421376.org trap_table + TT_CPU_MONDO*ENTRY_SIZE
    422 .global cpu_mondo_handler_tl0
    423 cpu_mondo_handler_tl0:
     377SYMBOL(cpu_mondo_handler_tl0)
    424378        mov TT_CPU_MONDO, %g2
    425379        clr %g5
     
    428382/* TT = 0x80, TL = 0, spill_0_normal handler */
    429383.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
    430 .global spill_0_normal_tl0
    431 spill_0_normal_tl0:
     384SYMBOL(spill_0_normal_tl0)
    432385        SPILL_NORMAL_HANDLER_KERNEL
    433386
    434387/* TT = 0x84, TL = 0, spill_1_normal handler */
    435388.org trap_table + TT_SPILL_1_NORMAL*ENTRY_SIZE
    436 .global spill_1_normal_tl0
    437 spill_1_normal_tl0:
     389SYMBOL(spill_1_normal_tl0)
    438390        SPILL_NORMAL_HANDLER_USERSPACE
    439391
    440392/* TT = 0x88, TL = 0, spill_2_normal handler */
    441393.org trap_table + TT_SPILL_2_NORMAL*ENTRY_SIZE
    442 .global spill_2_normal_tl0
    443 spill_2_normal_tl0:
     394SYMBOL(spill_2_normal_tl0)
    444395        SPILL_TO_USPACE_WINDOW_BUFFER
    445396
    446397/* TT = 0xa0, TL = 0, spill_0_other handler */
    447398.org trap_table + TT_SPILL_0_OTHER*ENTRY_SIZE
    448 .global spill_0_other_tl0
    449 spill_0_other_tl0:
     399SYMBOL(spill_0_other_tl0)
    450400        SPILL_TO_USPACE_WINDOW_BUFFER
    451401
    452402/* TT = 0xc0, TL = 0, fill_0_normal handler */
    453403.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
    454 .global fill_0_normal_tl0
    455 fill_0_normal_tl0:
     404SYMBOL(fill_0_normal_tl0)
    456405        FILL_NORMAL_HANDLER_KERNEL
    457406
    458407/* TT = 0xc4, TL = 0, fill_1_normal handler */
    459408.org trap_table + TT_FILL_1_NORMAL*ENTRY_SIZE
    460 .global fill_1_normal_tl0
    461 fill_1_normal_tl0:
     409SYMBOL(fill_1_normal_tl0)
    462410        FILL_NORMAL_HANDLER_USERSPACE
    463411
     
    472420    127
    473421.org trap_table + (TT_TRAP_INSTRUCTION_0+\cur)*ENTRY_SIZE
    474 .global trap_instruction_\cur\()_tl0
    475 trap_instruction_\cur\()_tl0:
     422SYMBOL(trap_instruction_\cur\()_tl0)
    476423        mov \cur, %g2
    477424        ba %xcc, trap_instruction_handler
     
    486433/* TT = 0x08, TL > 0, IAE_privilege_violation on UltraSPARC T2 */
    487434.org trap_table + (TT_INSTRUCTION_ACCESS_EXCEPTION+512)*ENTRY_SIZE
    488 .global instruction_access_exception_tl1
    489 instruction_access_exception_tl1:
     435SYMBOL(instruction_access_exception_tl1)
    490436        wrpr %g0, 1, %tl
    491437        mov TT_INSTRUCTION_ACCESS_EXCEPTION, %g2
     
    495441/* TT = 0x09, TL > 0, instruction_access_mmu_miss */
    496442.org trap_table + (TT_INSTRUCTION_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    497 .global instruction_access_mmu_miss_handler_tl1
     443SYMBOL(instruction_access_mmu_miss_handler_tl1)
    498444        wrpr %g0, 1, %tl
    499445        ba,a %xcc, fast_instruction_access_mmu_miss_handler_tl0
     
    501447/* TT = 0x0a, TL > 0, instruction_access_error */
    502448.org trap_table + (TT_INSTRUCTION_ACCESS_ERROR+512)*ENTRY_SIZE
    503 .global instruction_access_error_tl1
    504 instruction_access_error_tl1:
     449SYMBOL(instruction_access_error_tl1)
    505450        wrpr %g0, 1, %tl
    506451        mov TT_INSTRUCTION_ACCESS_ERROR, %g2
     
    510455/* TT = 0x0b, TL > 0, IAE_unauth_access */
    511456.org trap_table + (TT_IAE_UNAUTH_ACCESS+512)*ENTRY_SIZE
    512 .global iae_unauth_access_tl1
    513 iae_unauth_access_tl1:
     457SYMBOL(iae_unauth_access_tl1)
    514458        wrpr %g0, 1, %tl
    515459        mov TT_IAE_UNAUTH_ACCESS, %g2
     
    519463/* TT = 0x0c, TL > 0, IAE_nfo_page */
    520464.org trap_table + (TT_IAE_NFO_PAGE+512)*ENTRY_SIZE
    521 .global iae_nfo_page_tl1
    522 iae_nfo_page_tl1:
     465SYMBOL(iae_nfo_page_tl1)
    523466        wrpr %g0, 1, %tl
    524467        mov TT_IAE_NFO_PAGE, %g2
     
    528471/* TT = 0x10, TL > 0, illegal_instruction */
    529472.org trap_table + (TT_ILLEGAL_INSTRUCTION+512)*ENTRY_SIZE
    530 .global illegal_instruction_tl1
    531 illegal_instruction_tl1:
     473SYMBOL(illegal_instruction_tl1)
    532474        wrpr %g0, 1, %tl
    533475        mov TT_ILLEGAL_INSTRUCTION, %g2
     
    537479/* TT = 0x14, TL > 0, DAE_invalid_asi */
    538480.org trap_table + (TT_DAE_INVALID_ASI+512)*ENTRY_SIZE
    539 .global dae_invalid_asi_tl1
    540 dae_invalid_asi_tl1:
     481SYMBOL(dae_invalid_asi_tl1)
    541482        wrpr %g0, 1, %tl
    542483        mov TT_DAE_INVALID_ASI, %g2
     
    546487/* TT = 0x15, TL > 0, DAE_privilege_violation */
    547488.org trap_table + (TT_DAE_PRIVILEGE_VIOLATION+512)*ENTRY_SIZE
    548 .global dae_privilege_violation_tl1
    549 dae_privilege_violation_tl1:
     489SYMBOL(dae_privilege_violation_tl1)
    550490        wrpr %g0, 1, %tl
    551491        mov TT_DAE_PRIVILEGE_VIOLATION, %g2
     
    555495/* TT = 0x16, TL > 0, DAE_nc_page */
    556496.org trap_table + (TT_DAE_NC_PAGE+512)*ENTRY_SIZE
    557 .global dae_nc_page_tl1
    558 dae_nc_page_tl1:
     497SYMBOL(dae_nc_page_tl1)
    559498        wrpr %g0, 1, %tl
    560499        mov TT_DAE_NC_PAGE, %g2
     
    564503/* TT = 0x17, TL > 0, DAE_nfo_page */
    565504.org trap_table + (TT_DAE_NFO_PAGE+512)*ENTRY_SIZE
    566 .global dae_nfo_page_tl1
    567 dae_nfo_page_tl1:
     505SYMBOL(dae_nfo_page_tl1)
    568506        wrpr %g0, 1, %tl
    569507        mov TT_DAE_NFO_PAGE, %g2
     
    573511/* TT = 0x24, TL > 0, clean_window handler */
    574512.org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE
    575 .global clean_window_tl1
    576 clean_window_tl1:
     513SYMBOL(clean_window_tl1)
    577514        CLEAN_WINDOW_HANDLER
    578515
    579516/* TT = 0x28, TL > 0, division_by_zero */
    580517.org trap_table + (TT_DIVISION_BY_ZERO+512)*ENTRY_SIZE
    581 .global division_by_zero_tl1
    582 division_by_zero_tl1:
     518SYMBOL(division_by_zero_tl1)
    583519        wrpr %g0, 1, %tl
    584520        mov TT_DIVISION_BY_ZERO, %g2
     
    588524/* TT = 0x30, TL > 0, data_access_exception */
    589525.org trap_table + (TT_DATA_ACCESS_EXCEPTION+512)*ENTRY_SIZE
    590 .global data_access_exception_tl1
    591 data_access_exception_tl1:
     526SYMBOL(data_access_exception_tl1)
    592527        wrpr %g0, 1, %tl
    593528        mov TT_DATA_ACCESS_EXCEPTION, %g2
     
    597532/* TT = 0x31, TL > 0, data_access_mmu_miss */
    598533.org trap_table + (TT_DATA_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    599 .global data_access_mmu_miss_tl1
    600 data_access_mmu_miss_tl1:
     534SYMBOL(data_access_mmu_miss_tl1)
    601535        ba,a %xcc, fast_data_access_mmu_miss_handler_tl1
    602536
    603537/* TT = 0x32, TL > 0, data_access_error */
    604538.org trap_table + (TT_DATA_ACCESS_ERROR+512)*ENTRY_SIZE
    605 .global data_access_error_tl1
    606 data_access_error_tl1:
     539SYMBOL(data_access_error_tl1)
    607540        wrpr %g0, 1, %tl
    608541        mov TT_DATA_ACCESS_ERROR, %g2
     
    612545/* TT = 0x34, TL > 0, mem_address_not_aligned */
    613546.org trap_table + (TT_MEM_ADDRESS_NOT_ALIGNED+512)*ENTRY_SIZE
    614 .global mem_address_not_aligned_tl1
    615 mem_address_not_aligned_tl1:
     547SYMBOL(mem_address_not_aligned_tl1)
    616548        wrpr %g0, 1, %tl
    617549        mov TT_MEM_ADDRESS_NOT_ALIGNED, %g2
     
    621553/* TT = 0x68, TL > 0, fast_data_access_MMU_miss */
    622554.org trap_table + (TT_FAST_DATA_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    623 .global fast_data_access_mmu_miss_handler_tl1
    624 fast_data_access_mmu_miss_handler_tl1:
     555SYMBOL(fast_data_access_mmu_miss_handler_tl1)
    625556        FAST_DATA_ACCESS_MMU_MISS_HANDLER 1
    626557
    627558/* TT = 0x6c, TL > 0, fast_data_access_protection */
    628559.org trap_table + (TT_FAST_DATA_ACCESS_PROTECTION+512)*ENTRY_SIZE
    629 .global fast_data_access_protection_handler_tl1
    630 fast_data_access_protection_handler_tl1:
     560SYMBOL(fast_data_access_protection_handler_tl1)
    631561        FAST_DATA_ACCESS_PROTECTION_HANDLER 1
    632562
    633563/* TT = 0x7c, TL > 0, cpu_mondo */
    634564.org trap_table + (TT_CPU_MONDO+512)*ENTRY_SIZE
    635 .global cpu_mondo_handler_tl1
    636 cpu_mondo_handler_tl1:
     565SYMBOL(cpu_mondo_handler_tl1)
    637566        wrpr %g0, %tl
    638567        mov TT_CPU_MONDO, %g2
     
    642571/* TT = 0x80, TL > 0, spill_0_normal handler */
    643572.org trap_table + (TT_SPILL_0_NORMAL+512)*ENTRY_SIZE
    644 .global spill_0_normal_tl1
    645 spill_0_normal_tl1:
     573SYMBOL(spill_0_normal_tl1)
    646574        SPILL_NORMAL_HANDLER_KERNEL
    647575
    648576/* TT = 0x88, TL > 0, spill_2_normal handler */
    649577.org trap_table + (TT_SPILL_2_NORMAL+512)*ENTRY_SIZE
    650 .global spill_2_normal_tl1
    651 spill_2_normal_tl1:
     578SYMBOL(spill_2_normal_tl1)
    652579        SPILL_TO_USPACE_WINDOW_BUFFER
    653580
    654581/* TT = 0xa0, TL > 0, spill_0_other handler */
    655582.org trap_table + (TT_SPILL_0_OTHER+512)*ENTRY_SIZE
    656 .global spill_0_other_tl1
    657 spill_0_other_tl1:
     583SYMBOL(spill_0_other_tl1)
    658584        SPILL_TO_USPACE_WINDOW_BUFFER
    659585
    660586/* TT = 0xc0, TL > 0, fill_0_normal handler */
    661587.org trap_table + (TT_FILL_0_NORMAL+512)*ENTRY_SIZE
    662 .global fill_0_normal_tl1
    663 fill_0_normal_tl1:
     588SYMBOL(fill_0_normal_tl1)
    664589        FILL_NORMAL_HANDLER_KERNEL
    665590
     
    11781103.endm
    11791104
    1180 .global preemptible_handler
    1181 preemptible_handler:
     1105SYMBOL(preemptible_handler)
    11821106        PREEMPTIBLE_HANDLER_TEMPLATE 0
    11831107
    1184 .global trap_instruction_handler
    1185 trap_instruction_handler:
     1108SYMBOL(trap_instruction_handler)
    11861109        PREEMPTIBLE_HANDLER_TEMPLATE 1
  • kernel/generic/include/syscall/syscall.h

    r6adb775f r32573ff  
    4545extern sysarg_t syscall_handler(sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    4646    sysarg_t, sysarg_t, sysarg_t);
    47 extern sysarg_t sys_tls_set(uintptr_t);
    4847
    4948#endif
  • kernel/generic/src/syscall/syscall.c

    r6adb775f r32573ff  
    124124        /* System management syscalls. */
    125125        (syshandler_t) sys_kio,
    126         (syshandler_t) sys_tls_set,
    127126       
    128127        /* Thread and task related syscalls. */
Note: See TracChangeset for help on using the changeset viewer.