Changeset a5c78a18 in mainline


Ignore:
Timestamp:
2019-02-03T14:35:44Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4f1171
Parents:
67ca359
Message:

Rename context_t to context_t

<libarch/fibril_context.h> is included from <setjmp.h> where it can interfere
with identifiers used in third-party code.
The simplest solution here is just to prefix the names with double underscore
which is reserved for use by the implementation.

Location:
uspace/lib/c
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/abs32le/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3636 * need to be preserved across function calls.
    3737 */
    38 typedef struct context {
     38typedef struct __context {
    3939        uintptr_t sp;
    4040        uintptr_t fp;
    4141        uintptr_t pc;
    4242        uintptr_t tls;
    43 } context_t;
     43} __context_t;
    4444
    4545#endif
  • uspace/lib/c/arch/abs32le/src/fibril.c

    r67ca359 ra5c78a18  
    3333#include <stdbool.h>
    3434
    35 int __setjmp(context_t *ctx)
     35int __setjmp(__context_t *ctx)
    3636{
    3737        return 0;
    3838}
    3939
    40 void __longjmp(context_t *ctx, int val)
     40void __longjmp(__context_t *ctx, int val)
    4141{
    4242        while (true)
  • uspace/lib/c/arch/amd64/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x08
    34 #define CONTEXT_OFFSET_RBX  0x10
    35 #define CONTEXT_OFFSET_RBP  0x18
    36 #define CONTEXT_OFFSET_R12  0x20
    37 #define CONTEXT_OFFSET_R13  0x28
    38 #define CONTEXT_OFFSET_R14  0x30
    39 #define CONTEXT_OFFSET_R15  0x38
    40 #define CONTEXT_OFFSET_TLS  0x40
    41 #define CONTEXT_SIZE        0x48
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x08
     34#define __CONTEXT_OFFSET_RBX  0x10
     35#define __CONTEXT_OFFSET_RBP  0x18
     36#define __CONTEXT_OFFSET_R12  0x20
     37#define __CONTEXT_OFFSET_R13  0x28
     38#define __CONTEXT_OFFSET_R14  0x30
     39#define __CONTEXT_OFFSET_R15  0x38
     40#define __CONTEXT_OFFSET_TLS  0x40
     41#define __CONTEXT_SIZE        0x48
    4242
    4343#ifndef __ASSEMBLER__
     
    4545#include <stdint.h>
    4646
    47 typedef struct context {
     47typedef struct __context {
    4848        /*
    4949         * We include only registers that must be preserved
     
    5959        uint64_t r15;
    6060        uint64_t tls;
    61 } context_t;
     61} __context_t;
    6262
    6363#endif
  • uspace/lib/c/arch/amd64/src/fibril.S

    r67ca359 ra5c78a18  
    4141
    4242        # in %rdi is passed 1st argument
    43         movq %rdx, CONTEXT_OFFSET_PC(%rdi)
    44         movq %rsp, CONTEXT_OFFSET_SP(%rdi)
     43        movq %rdx, __CONTEXT_OFFSET_PC(%rdi)
     44        movq %rsp, __CONTEXT_OFFSET_SP(%rdi)
    4545
    46         movq %rbx, CONTEXT_OFFSET_RBX(%rdi)
    47         movq %rbp, CONTEXT_OFFSET_RBP(%rdi)
    48         movq %r12, CONTEXT_OFFSET_R12(%rdi)
    49         movq %r13, CONTEXT_OFFSET_R13(%rdi)
    50         movq %r14, CONTEXT_OFFSET_R14(%rdi)
    51         movq %r15, CONTEXT_OFFSET_R15(%rdi)
     46        movq %rbx, __CONTEXT_OFFSET_RBX(%rdi)
     47        movq %rbp, __CONTEXT_OFFSET_RBP(%rdi)
     48        movq %r12, __CONTEXT_OFFSET_R12(%rdi)
     49        movq %r13, __CONTEXT_OFFSET_R13(%rdi)
     50        movq %r14, __CONTEXT_OFFSET_R14(%rdi)
     51        movq %r15, __CONTEXT_OFFSET_R15(%rdi)
    5252
    5353        movq %fs:0, %rax
    54         movq %rax, CONTEXT_OFFSET_TLS(%rdi)
     54        movq %rax, __CONTEXT_OFFSET_TLS(%rdi)
    5555
    5656        xorq %rax, %rax                      # __setjmp returns 0
     
    6464#
    6565FUNCTION_BEGIN(__longjmp)
    66         movq CONTEXT_OFFSET_R15(%rdi), %r15
    67         movq CONTEXT_OFFSET_R14(%rdi), %r14
    68         movq CONTEXT_OFFSET_R13(%rdi), %r13
    69         movq CONTEXT_OFFSET_R12(%rdi), %r12
    70         movq CONTEXT_OFFSET_RBP(%rdi), %rbp
    71         movq CONTEXT_OFFSET_RBX(%rdi), %rbx
     66        movq __CONTEXT_OFFSET_R15(%rdi), %r15
     67        movq __CONTEXT_OFFSET_R14(%rdi), %r14
     68        movq __CONTEXT_OFFSET_R13(%rdi), %r13
     69        movq __CONTEXT_OFFSET_R12(%rdi), %r12
     70        movq __CONTEXT_OFFSET_RBP(%rdi), %rbp
     71        movq __CONTEXT_OFFSET_RBX(%rdi), %rbx
    7272
    73         movq CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
     73        movq __CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
    7474
    75         movq CONTEXT_OFFSET_PC(%rdi), %rdx
     75        movq __CONTEXT_OFFSET_PC(%rdi), %rdx
    7676
    7777        movq %rdx,(%rsp)
    7878
    79         movq CONTEXT_OFFSET_TLS(%rdi), %rdi
     79        movq __CONTEXT_OFFSET_TLS(%rdi), %rdi
    8080        movq %rdi, %fs:0
    8181
  • uspace/lib/c/arch/arm32/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    4141// XXX: This struct must match the assembly code in src/fibril.S
    4242
    43 typedef struct context {
     43typedef struct __context {
    4444        uintptr_t sp;
    4545        uintptr_t pc;
     
    5454        /* r11 */
    5555        uint32_t fp;
    56 } context_t;
     56} __context_t;
    5757
    5858#endif
  • uspace/lib/c/arch/ia32/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x04
    34 #define CONTEXT_OFFSET_EBX  0x08
    35 #define CONTEXT_OFFSET_ESI  0x0c
    36 #define CONTEXT_OFFSET_EDI  0x10
    37 #define CONTEXT_OFFSET_EBP  0x14
    38 #define CONTEXT_OFFSET_TLS  0x18
    39 #define CONTEXT_SIZE        0x1c
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x04
     34#define __CONTEXT_OFFSET_EBX  0x08
     35#define __CONTEXT_OFFSET_ESI  0x0c
     36#define __CONTEXT_OFFSET_EDI  0x10
     37#define __CONTEXT_OFFSET_EBP  0x14
     38#define __CONTEXT_OFFSET_TLS  0x18
     39#define __CONTEXT_SIZE        0x1c
    4040
    4141#ifndef __ASSEMBLER__
     
    4444
    4545/* We include only registers that must be preserved during function call. */
    46 typedef struct context {
     46typedef struct __context {
    4747        uint32_t sp;
    4848        uint32_t pc;
     
    5252        uint32_t ebp;
    5353        uint32_t tls;
    54 } context_t;
     54} __context_t;
    5555
    5656#endif
  • uspace/lib/c/arch/ia32/src/fibril.S

    r67ca359 ra5c78a18  
    4242
    4343        # save registers to the context structure
    44         movl %esp, CONTEXT_OFFSET_SP(%edx)      # %esp -> ctx->sp
    45         movl %eax, CONTEXT_OFFSET_PC(%edx)      # %eip -> ctx->pc
    46         movl %ebx, CONTEXT_OFFSET_EBX(%edx)     # %ebx -> ctx->ebx
    47         movl %esi, CONTEXT_OFFSET_ESI(%edx)     # %esi -> ctx->esi
    48         movl %edi, CONTEXT_OFFSET_EDI(%edx)     # %edi -> ctx->edi
    49         movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
     44        movl %esp, __CONTEXT_OFFSET_SP(%edx)    # %esp -> ctx->sp
     45        movl %eax, __CONTEXT_OFFSET_PC(%edx)    # %eip -> ctx->pc
     46        movl %ebx, __CONTEXT_OFFSET_EBX(%edx)   # %ebx -> ctx->ebx
     47        movl %esi, __CONTEXT_OFFSET_ESI(%edx)   # %esi -> ctx->esi
     48        movl %edi, __CONTEXT_OFFSET_EDI(%edx)   # %edi -> ctx->edi
     49        movl %ebp, __CONTEXT_OFFSET_EBP(%edx)   # %ebp -> ctx->ebp
    5050
    5151        # save TLS
    5252        movl %gs:0, %eax
    53         movl %eax, CONTEXT_OFFSET_TLS(%edx)     # tls -> ctx->tls
     53        movl %eax, __CONTEXT_OFFSET_TLS(%edx)   # tls -> ctx->tls
    5454
    5555        xorl %eax, %eax         # __setjmp returns 0
     
    6767
    6868        # restore registers from the context structure
    69         movl CONTEXT_OFFSET_SP(%eax),%esp       # ctx->sp -> %esp
    70         movl CONTEXT_OFFSET_PC(%eax),%edx       # ctx->pc -> \pc
    71         movl CONTEXT_OFFSET_EBX(%eax),%ebx      # ctx->ebx -> %ebx
    72         movl CONTEXT_OFFSET_ESI(%eax),%esi      # ctx->esi -> %esi
    73         movl CONTEXT_OFFSET_EDI(%eax),%edi      # ctx->edi -> %edi
    74         movl CONTEXT_OFFSET_EBP(%eax),%ebp      # ctx->ebp -> %ebp
     69        movl __CONTEXT_OFFSET_SP(%eax),%esp     # ctx->sp -> %esp
     70        movl __CONTEXT_OFFSET_PC(%eax),%edx     # ctx->pc -> \pc
     71        movl __CONTEXT_OFFSET_EBX(%eax),%ebx    # ctx->ebx -> %ebx
     72        movl __CONTEXT_OFFSET_ESI(%eax),%esi    # ctx->esi -> %esi
     73        movl __CONTEXT_OFFSET_EDI(%eax),%edi    # ctx->edi -> %edi
     74        movl __CONTEXT_OFFSET_EBP(%eax),%ebp    # ctx->ebp -> %ebp
    7575
    7676        movl %edx, 0(%esp)  # ctx->pc -> saver's return %eip
    7777
    7878        # set thread local storage
    79         movl CONTEXT_OFFSET_TLS(%eax), %edx     # Set arg1 to TLS addr
     79        movl __CONTEXT_OFFSET_TLS(%eax), %edx   # Set arg1 to TLS addr
    8080        movl %edx, %gs:0
    8181
  • uspace/lib/c/arch/ia64/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_AR_PFS          0x000
    33 #define CONTEXT_OFFSET_AR_UNAT_CALLER  0x008
    34 #define CONTEXT_OFFSET_AR_UNAT_CALLEE  0x010
    35 #define CONTEXT_OFFSET_AR_RSC          0x018
    36 #define CONTEXT_OFFSET_BSP             0x020
    37 #define CONTEXT_OFFSET_AR_RNAT         0x028
    38 #define CONTEXT_OFFSET_AR_LC           0x030
    39 #define CONTEXT_OFFSET_R1              0x038
    40 #define CONTEXT_OFFSET_R4              0x040
    41 #define CONTEXT_OFFSET_R5              0x048
    42 #define CONTEXT_OFFSET_R6              0x050
    43 #define CONTEXT_OFFSET_R7              0x058
    44 #define CONTEXT_OFFSET_SP              0x060
    45 #define CONTEXT_OFFSET_TP              0x068
    46 #define CONTEXT_OFFSET_PC              0x070
    47 #define CONTEXT_OFFSET_B1              0x078
    48 #define CONTEXT_OFFSET_B2              0x080
    49 #define CONTEXT_OFFSET_B3              0x088
    50 #define CONTEXT_OFFSET_B4              0x090
    51 #define CONTEXT_OFFSET_B5              0x098
    52 #define CONTEXT_OFFSET_PR              0x0a0
    53 #define CONTEXT_OFFSET_F2              0x0b0
    54 #define CONTEXT_OFFSET_F3              0x0c0
    55 #define CONTEXT_OFFSET_F4              0x0d0
    56 #define CONTEXT_OFFSET_F5              0x0e0
    57 #define CONTEXT_OFFSET_F16             0x0f0
    58 #define CONTEXT_OFFSET_F17             0x100
    59 #define CONTEXT_OFFSET_F18             0x110
    60 #define CONTEXT_OFFSET_F19             0x120
    61 #define CONTEXT_OFFSET_F20             0x130
    62 #define CONTEXT_OFFSET_F21             0x140
    63 #define CONTEXT_OFFSET_F22             0x150
    64 #define CONTEXT_OFFSET_F23             0x160
    65 #define CONTEXT_OFFSET_F24             0x170
    66 #define CONTEXT_OFFSET_F25             0x180
    67 #define CONTEXT_OFFSET_F26             0x190
    68 #define CONTEXT_OFFSET_F27             0x1a0
    69 #define CONTEXT_OFFSET_F28             0x1b0
    70 #define CONTEXT_OFFSET_F29             0x1c0
    71 #define CONTEXT_OFFSET_F30             0x1d0
    72 #define CONTEXT_OFFSET_F31             0x1e0
    73 #define CONTEXT_SIZE                   0x1f0
     32#define __CONTEXT_OFFSET_AR_PFS          0x000
     33#define __CONTEXT_OFFSET_AR_UNAT_CALLER  0x008
     34#define __CONTEXT_OFFSET_AR_UNAT_CALLEE  0x010
     35#define __CONTEXT_OFFSET_AR_RSC          0x018
     36#define __CONTEXT_OFFSET_BSP             0x020
     37#define __CONTEXT_OFFSET_AR_RNAT         0x028
     38#define __CONTEXT_OFFSET_AR_LC           0x030
     39#define __CONTEXT_OFFSET_R1              0x038
     40#define __CONTEXT_OFFSET_R4              0x040
     41#define __CONTEXT_OFFSET_R5              0x048
     42#define __CONTEXT_OFFSET_R6              0x050
     43#define __CONTEXT_OFFSET_R7              0x058
     44#define __CONTEXT_OFFSET_SP              0x060
     45#define __CONTEXT_OFFSET_TP              0x068
     46#define __CONTEXT_OFFSET_PC              0x070
     47#define __CONTEXT_OFFSET_B1              0x078
     48#define __CONTEXT_OFFSET_B2              0x080
     49#define __CONTEXT_OFFSET_B3              0x088
     50#define __CONTEXT_OFFSET_B4              0x090
     51#define __CONTEXT_OFFSET_B5              0x098
     52#define __CONTEXT_OFFSET_PR              0x0a0
     53#define __CONTEXT_OFFSET_F2              0x0b0
     54#define __CONTEXT_OFFSET_F3              0x0c0
     55#define __CONTEXT_OFFSET_F4              0x0d0
     56#define __CONTEXT_OFFSET_F5              0x0e0
     57#define __CONTEXT_OFFSET_F16             0x0f0
     58#define __CONTEXT_OFFSET_F17             0x100
     59#define __CONTEXT_OFFSET_F18             0x110
     60#define __CONTEXT_OFFSET_F19             0x120
     61#define __CONTEXT_OFFSET_F20             0x130
     62#define __CONTEXT_OFFSET_F21             0x140
     63#define __CONTEXT_OFFSET_F22             0x150
     64#define __CONTEXT_OFFSET_F23             0x160
     65#define __CONTEXT_OFFSET_F24             0x170
     66#define __CONTEXT_OFFSET_F25             0x180
     67#define __CONTEXT_OFFSET_F26             0x190
     68#define __CONTEXT_OFFSET_F27             0x1a0
     69#define __CONTEXT_OFFSET_F28             0x1b0
     70#define __CONTEXT_OFFSET_F29             0x1c0
     71#define __CONTEXT_OFFSET_F30             0x1d0
     72#define __CONTEXT_OFFSET_F31             0x1e0
     73#define __CONTEXT_SIZE                   0x1f0
    7474
    7575#ifndef __ASSEMBLER__
     
    7979
    8080// Only save registers that must be preserved across function calls.
    81 typedef struct context {
     81typedef struct __context {
    8282        // Application registers.
    8383        uint64_t ar_pfs;
     
    132132        uint128_t f30;
    133133        uint128_t f31;
    134 } context_t;
     134} __context_t;
    135135
    136136#endif  /* __ASSEMBLER__ */
  • uspace/lib/c/arch/ia64/src/fibril.S

    r67ca359 ra5c78a18  
    5858        mov loc6 = ar.lc
    5959
    60         add loc8 = CONTEXT_OFFSET_AR_PFS, in0
    61         add loc9 = CONTEXT_OFFSET_AR_UNAT_CALLER, in0
    62         add loc10 = CONTEXT_OFFSET_AR_UNAT_CALLEE, in0
    63         add loc11 = CONTEXT_OFFSET_AR_RSC, in0
    64         add loc12 = CONTEXT_OFFSET_BSP, in0
    65         add loc13 = CONTEXT_OFFSET_AR_RNAT, in0
    66         add loc14 = CONTEXT_OFFSET_AR_LC, in0
    67 
    68         add loc15 = CONTEXT_OFFSET_R1, in0
    69         add loc16 = CONTEXT_OFFSET_R4, in0
    70         add loc17 = CONTEXT_OFFSET_R5, in0
    71         add loc18 = CONTEXT_OFFSET_R6, in0
    72         add loc19 = CONTEXT_OFFSET_R7, in0
    73         add loc20 = CONTEXT_OFFSET_SP, in0
    74         add loc21 = CONTEXT_OFFSET_TP, in0
    75 
    76         add loc22 = CONTEXT_OFFSET_PC, in0
    77         add loc23 = CONTEXT_OFFSET_B1, in0
    78         add loc24 = CONTEXT_OFFSET_B2, in0
    79         add loc25 = CONTEXT_OFFSET_B3, in0
    80         add loc26 = CONTEXT_OFFSET_B4, in0
    81         add loc27 = CONTEXT_OFFSET_B5, in0
    82 
    83         add loc28 = CONTEXT_OFFSET_PR, in0
    84 
    85         add loc29 = CONTEXT_OFFSET_F2, in0
    86         add loc30 = CONTEXT_OFFSET_F3, in0
    87         add loc31 = CONTEXT_OFFSET_F4, in0
    88         add loc32 = CONTEXT_OFFSET_F5, in0
    89 
    90         add loc33 = CONTEXT_OFFSET_F16, in0
    91         add loc34 = CONTEXT_OFFSET_F17, in0
    92         add loc35 = CONTEXT_OFFSET_F18, in0
    93         add loc36 = CONTEXT_OFFSET_F19, in0
    94         add loc37 = CONTEXT_OFFSET_F20, in0
    95         add loc38 = CONTEXT_OFFSET_F21, in0
    96         add loc39 = CONTEXT_OFFSET_F22, in0
    97         add loc40 = CONTEXT_OFFSET_F23, in0
    98         add loc41 = CONTEXT_OFFSET_F24, in0
    99         add loc42 = CONTEXT_OFFSET_F25, in0
    100         add loc43 = CONTEXT_OFFSET_F26, in0
    101         add loc44 = CONTEXT_OFFSET_F27, in0
    102         add loc45 = CONTEXT_OFFSET_F28, in0
    103         add loc46 = CONTEXT_OFFSET_F29, in0
    104         add loc47 = CONTEXT_OFFSET_F30, in0
    105         add loc48 = CONTEXT_OFFSET_F31, in0 ;;
     60        add loc8 = __CONTEXT_OFFSET_AR_PFS, in0
     61        add loc9 = __CONTEXT_OFFSET_AR_UNAT_CALLER, in0
     62        add loc10 = __CONTEXT_OFFSET_AR_UNAT_CALLEE, in0
     63        add loc11 = __CONTEXT_OFFSET_AR_RSC, in0
     64        add loc12 = __CONTEXT_OFFSET_BSP, in0
     65        add loc13 = __CONTEXT_OFFSET_AR_RNAT, in0
     66        add loc14 = __CONTEXT_OFFSET_AR_LC, in0
     67
     68        add loc15 = __CONTEXT_OFFSET_R1, in0
     69        add loc16 = __CONTEXT_OFFSET_R4, in0
     70        add loc17 = __CONTEXT_OFFSET_R5, in0
     71        add loc18 = __CONTEXT_OFFSET_R6, in0
     72        add loc19 = __CONTEXT_OFFSET_R7, in0
     73        add loc20 = __CONTEXT_OFFSET_SP, in0
     74        add loc21 = __CONTEXT_OFFSET_TP, in0
     75
     76        add loc22 = __CONTEXT_OFFSET_PC, in0
     77        add loc23 = __CONTEXT_OFFSET_B1, in0
     78        add loc24 = __CONTEXT_OFFSET_B2, in0
     79        add loc25 = __CONTEXT_OFFSET_B3, in0
     80        add loc26 = __CONTEXT_OFFSET_B4, in0
     81        add loc27 = __CONTEXT_OFFSET_B5, in0
     82
     83        add loc28 = __CONTEXT_OFFSET_PR, in0
     84
     85        add loc29 = __CONTEXT_OFFSET_F2, in0
     86        add loc30 = __CONTEXT_OFFSET_F3, in0
     87        add loc31 = __CONTEXT_OFFSET_F4, in0
     88        add loc32 = __CONTEXT_OFFSET_F5, in0
     89
     90        add loc33 = __CONTEXT_OFFSET_F16, in0
     91        add loc34 = __CONTEXT_OFFSET_F17, in0
     92        add loc35 = __CONTEXT_OFFSET_F18, in0
     93        add loc36 = __CONTEXT_OFFSET_F19, in0
     94        add loc37 = __CONTEXT_OFFSET_F20, in0
     95        add loc38 = __CONTEXT_OFFSET_F21, in0
     96        add loc39 = __CONTEXT_OFFSET_F22, in0
     97        add loc40 = __CONTEXT_OFFSET_F23, in0
     98        add loc41 = __CONTEXT_OFFSET_F24, in0
     99        add loc42 = __CONTEXT_OFFSET_F25, in0
     100        add loc43 = __CONTEXT_OFFSET_F26, in0
     101        add loc44 = __CONTEXT_OFFSET_F27, in0
     102        add loc45 = __CONTEXT_OFFSET_F28, in0
     103        add loc46 = __CONTEXT_OFFSET_F29, in0
     104        add loc47 = __CONTEXT_OFFSET_F30, in0
     105        add loc48 = __CONTEXT_OFFSET_F31, in0 ;;
    106106
    107107        /*
     
    185185        alloc loc0 = ar.pfs, 2, 50, 0, 0 ;;
    186186
    187         add loc9 = CONTEXT_OFFSET_AR_PFS, in0
    188         add loc10 = CONTEXT_OFFSET_AR_UNAT_CALLER, in0
    189         add loc11 = CONTEXT_OFFSET_AR_UNAT_CALLEE, in0
    190         add loc12 = CONTEXT_OFFSET_AR_RSC, in0
    191         add loc13 = CONTEXT_OFFSET_BSP, in0
    192         add loc14 = CONTEXT_OFFSET_AR_RNAT, in0
    193         add loc15 = CONTEXT_OFFSET_AR_LC, in0
    194 
    195         add loc16 = CONTEXT_OFFSET_R1, in0
    196         add loc17 = CONTEXT_OFFSET_R4, in0
    197         add loc18 = CONTEXT_OFFSET_R5, in0
    198         add loc19 = CONTEXT_OFFSET_R6, in0
    199         add loc20 = CONTEXT_OFFSET_R7, in0
    200         add loc21 = CONTEXT_OFFSET_SP, in0
    201         add loc22 = CONTEXT_OFFSET_TP, in0
    202 
    203         add loc23 = CONTEXT_OFFSET_PC, in0
    204         add loc24 = CONTEXT_OFFSET_B1, in0
    205         add loc25 = CONTEXT_OFFSET_B2, in0
    206         add loc26 = CONTEXT_OFFSET_B3, in0
    207         add loc27 = CONTEXT_OFFSET_B4, in0
    208         add loc28 = CONTEXT_OFFSET_B5, in0
    209 
    210         add loc29 = CONTEXT_OFFSET_PR, in0
    211 
    212         add loc30 = CONTEXT_OFFSET_F2, in0
    213         add loc31 = CONTEXT_OFFSET_F3, in0
    214         add loc32 = CONTEXT_OFFSET_F4, in0
    215         add loc33 = CONTEXT_OFFSET_F5, in0
    216 
    217         add loc34 = CONTEXT_OFFSET_F16, in0
    218         add loc35 = CONTEXT_OFFSET_F17, in0
    219         add loc36 = CONTEXT_OFFSET_F18, in0
    220         add loc37 = CONTEXT_OFFSET_F19, in0
    221         add loc38 = CONTEXT_OFFSET_F20, in0
    222         add loc39 = CONTEXT_OFFSET_F21, in0
    223         add loc40 = CONTEXT_OFFSET_F22, in0
    224         add loc41 = CONTEXT_OFFSET_F23, in0
    225         add loc42 = CONTEXT_OFFSET_F24, in0
    226         add loc43 = CONTEXT_OFFSET_F25, in0
    227         add loc44 = CONTEXT_OFFSET_F26, in0
    228         add loc45 = CONTEXT_OFFSET_F27, in0
    229         add loc46 = CONTEXT_OFFSET_F28, in0
    230         add loc47 = CONTEXT_OFFSET_F29, in0
    231         add loc48 = CONTEXT_OFFSET_F30, in0
    232         add loc49 = CONTEXT_OFFSET_F31, in0 ;;
     187        add loc9 = __CONTEXT_OFFSET_AR_PFS, in0
     188        add loc10 = __CONTEXT_OFFSET_AR_UNAT_CALLER, in0
     189        add loc11 = __CONTEXT_OFFSET_AR_UNAT_CALLEE, in0
     190        add loc12 = __CONTEXT_OFFSET_AR_RSC, in0
     191        add loc13 = __CONTEXT_OFFSET_BSP, in0
     192        add loc14 = __CONTEXT_OFFSET_AR_RNAT, in0
     193        add loc15 = __CONTEXT_OFFSET_AR_LC, in0
     194
     195        add loc16 = __CONTEXT_OFFSET_R1, in0
     196        add loc17 = __CONTEXT_OFFSET_R4, in0
     197        add loc18 = __CONTEXT_OFFSET_R5, in0
     198        add loc19 = __CONTEXT_OFFSET_R6, in0
     199        add loc20 = __CONTEXT_OFFSET_R7, in0
     200        add loc21 = __CONTEXT_OFFSET_SP, in0
     201        add loc22 = __CONTEXT_OFFSET_TP, in0
     202
     203        add loc23 = __CONTEXT_OFFSET_PC, in0
     204        add loc24 = __CONTEXT_OFFSET_B1, in0
     205        add loc25 = __CONTEXT_OFFSET_B2, in0
     206        add loc26 = __CONTEXT_OFFSET_B3, in0
     207        add loc27 = __CONTEXT_OFFSET_B4, in0
     208        add loc28 = __CONTEXT_OFFSET_B5, in0
     209
     210        add loc29 = __CONTEXT_OFFSET_PR, in0
     211
     212        add loc30 = __CONTEXT_OFFSET_F2, in0
     213        add loc31 = __CONTEXT_OFFSET_F3, in0
     214        add loc32 = __CONTEXT_OFFSET_F4, in0
     215        add loc33 = __CONTEXT_OFFSET_F5, in0
     216
     217        add loc34 = __CONTEXT_OFFSET_F16, in0
     218        add loc35 = __CONTEXT_OFFSET_F17, in0
     219        add loc36 = __CONTEXT_OFFSET_F18, in0
     220        add loc37 = __CONTEXT_OFFSET_F19, in0
     221        add loc38 = __CONTEXT_OFFSET_F20, in0
     222        add loc39 = __CONTEXT_OFFSET_F21, in0
     223        add loc40 = __CONTEXT_OFFSET_F22, in0
     224        add loc41 = __CONTEXT_OFFSET_F23, in0
     225        add loc42 = __CONTEXT_OFFSET_F24, in0
     226        add loc43 = __CONTEXT_OFFSET_F25, in0
     227        add loc44 = __CONTEXT_OFFSET_F26, in0
     228        add loc45 = __CONTEXT_OFFSET_F27, in0
     229        add loc46 = __CONTEXT_OFFSET_F28, in0
     230        add loc47 = __CONTEXT_OFFSET_F29, in0
     231        add loc48 = __CONTEXT_OFFSET_F30, in0
     232        add loc49 = __CONTEXT_OFFSET_F31, in0 ;;
    233233
    234234        ld8 loc0 = [loc9]       /* load ar.pfs */
  • uspace/lib/c/arch/mips32/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x04
    34 #define CONTEXT_OFFSET_S0   0x08
    35 #define CONTEXT_OFFSET_S1   0x0c
    36 #define CONTEXT_OFFSET_S2   0x10
    37 #define CONTEXT_OFFSET_S3   0x14
    38 #define CONTEXT_OFFSET_S4   0x18
    39 #define CONTEXT_OFFSET_S5   0x1c
    40 #define CONTEXT_OFFSET_S6   0x20
    41 #define CONTEXT_OFFSET_S7   0x24
    42 #define CONTEXT_OFFSET_S8   0x28
    43 #define CONTEXT_OFFSET_GP   0x2c
    44 #define CONTEXT_OFFSET_TLS  0x30
    45 #define CONTEXT_OFFSET_F20  0x34
    46 #define CONTEXT_OFFSET_F21  0x38
    47 #define CONTEXT_OFFSET_F22  0x3c
    48 #define CONTEXT_OFFSET_F23  0x40
    49 #define CONTEXT_OFFSET_F24  0x44
    50 #define CONTEXT_OFFSET_F25  0x48
    51 #define CONTEXT_OFFSET_F26  0x4c
    52 #define CONTEXT_OFFSET_F27  0x50
    53 #define CONTEXT_OFFSET_F28  0x54
    54 #define CONTEXT_OFFSET_F29  0x58
    55 #define CONTEXT_OFFSET_F30  0x5c
    56 #define CONTEXT_SIZE        0x60
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x04
     34#define __CONTEXT_OFFSET_S0   0x08
     35#define __CONTEXT_OFFSET_S1   0x0c
     36#define __CONTEXT_OFFSET_S2   0x10
     37#define __CONTEXT_OFFSET_S3   0x14
     38#define __CONTEXT_OFFSET_S4   0x18
     39#define __CONTEXT_OFFSET_S5   0x1c
     40#define __CONTEXT_OFFSET_S6   0x20
     41#define __CONTEXT_OFFSET_S7   0x24
     42#define __CONTEXT_OFFSET_S8   0x28
     43#define __CONTEXT_OFFSET_GP   0x2c
     44#define __CONTEXT_OFFSET_TLS  0x30
     45#define __CONTEXT_OFFSET_F20  0x34
     46#define __CONTEXT_OFFSET_F21  0x38
     47#define __CONTEXT_OFFSET_F22  0x3c
     48#define __CONTEXT_OFFSET_F23  0x40
     49#define __CONTEXT_OFFSET_F24  0x44
     50#define __CONTEXT_OFFSET_F25  0x48
     51#define __CONTEXT_OFFSET_F26  0x4c
     52#define __CONTEXT_OFFSET_F27  0x50
     53#define __CONTEXT_OFFSET_F28  0x54
     54#define __CONTEXT_OFFSET_F29  0x58
     55#define __CONTEXT_OFFSET_F30  0x5c
     56#define __CONTEXT_SIZE        0x60
    5757
    5858#ifndef __ASSEMBLER__
     
    6161#include <stdint.h>
    6262
    63 typedef struct context {
     63typedef struct __context {
    6464        uint32_t sp;
    6565        uint32_t pc;
     
    8787        uint32_t f29;
    8888        uint32_t f30;
    89 } context_t;
     89} __context_t;
    9090
    9191#endif
  • uspace/lib/c/arch/mips32/src/fibril.S

    r67ca359 ra5c78a18  
    3636
    3737FUNCTION_BEGIN(__setjmp)
    38         sw $s0, CONTEXT_OFFSET_S0($a0)
    39         sw $s1, CONTEXT_OFFSET_S1($a0)
    40         sw $s2, CONTEXT_OFFSET_S2($a0)
    41         sw $s3, CONTEXT_OFFSET_S3($a0)
    42         sw $s4, CONTEXT_OFFSET_S4($a0)
    43         sw $s5, CONTEXT_OFFSET_S5($a0)
    44         sw $s6, CONTEXT_OFFSET_S6($a0)
    45         sw $s7, CONTEXT_OFFSET_S7($a0)
    46         sw $s8, CONTEXT_OFFSET_S8($a0)
    47         sw $gp, CONTEXT_OFFSET_GP($a0)
     38        sw $s0, __CONTEXT_OFFSET_S0($a0)
     39        sw $s1, __CONTEXT_OFFSET_S1($a0)
     40        sw $s2, __CONTEXT_OFFSET_S2($a0)
     41        sw $s3, __CONTEXT_OFFSET_S3($a0)
     42        sw $s4, __CONTEXT_OFFSET_S4($a0)
     43        sw $s5, __CONTEXT_OFFSET_S5($a0)
     44        sw $s6, __CONTEXT_OFFSET_S6($a0)
     45        sw $s7, __CONTEXT_OFFSET_S7($a0)
     46        sw $s8, __CONTEXT_OFFSET_S8($a0)
     47        sw $gp, __CONTEXT_OFFSET_GP($a0)
    4848
    49         sw $k1, CONTEXT_OFFSET_TLS($a0)
     49        sw $k1, __CONTEXT_OFFSET_TLS($a0)
    5050
    5151#ifdef CONFIG_FPU
    5252        mfc1 $t0, $20
    53         sw $t0, CONTEXT_OFFSET_F20($a0)
     53        sw $t0, __CONTEXT_OFFSET_F20($a0)
    5454
    5555        mfc1 $t0, $21
    56         sw $t0, CONTEXT_OFFSET_F21($a0)
     56        sw $t0, __CONTEXT_OFFSET_F21($a0)
    5757
    5858        mfc1 $t0, $22
    59         sw $t0, CONTEXT_OFFSET_F22($a0)
     59        sw $t0, __CONTEXT_OFFSET_F22($a0)
    6060
    6161        mfc1 $t0, $23
    62         sw $t0, CONTEXT_OFFSET_F23($a0)
     62        sw $t0, __CONTEXT_OFFSET_F23($a0)
    6363
    6464        mfc1 $t0, $24
    65         sw $t0, CONTEXT_OFFSET_F24($a0)
     65        sw $t0, __CONTEXT_OFFSET_F24($a0)
    6666
    6767        mfc1 $t0, $25
    68         sw $t0, CONTEXT_OFFSET_F25($a0)
     68        sw $t0, __CONTEXT_OFFSET_F25($a0)
    6969
    7070        mfc1 $t0, $26
    71         sw $t0, CONTEXT_OFFSET_F26($a0)
     71        sw $t0, __CONTEXT_OFFSET_F26($a0)
    7272
    7373        mfc1 $t0, $27
    74         sw $t0, CONTEXT_OFFSET_F27($a0)
     74        sw $t0, __CONTEXT_OFFSET_F27($a0)
    7575
    7676        mfc1 $t0, $28
    77         sw $t0, CONTEXT_OFFSET_F28($a0)
     77        sw $t0, __CONTEXT_OFFSET_F28($a0)
    7878
    7979        mfc1 $t0, $29
    80         sw $t0, CONTEXT_OFFSET_F29($a0)
     80        sw $t0, __CONTEXT_OFFSET_F29($a0)
    8181
    8282        mfc1 $t0, $30
    83         sw $t0, CONTEXT_OFFSET_F30($a0)
     83        sw $t0, __CONTEXT_OFFSET_F30($a0)
    8484#endif /* CONFIG_FPU */
    8585
    86         sw $ra, CONTEXT_OFFSET_PC($a0)
    87         sw $sp, CONTEXT_OFFSET_SP($a0)
     86        sw $ra, __CONTEXT_OFFSET_PC($a0)
     87        sw $sp, __CONTEXT_OFFSET_SP($a0)
    8888
    8989        # __setjmp returns 0
     
    9393
    9494FUNCTION_BEGIN(__longjmp)
    95         lw $s0, CONTEXT_OFFSET_S0($a0)
    96         lw $s1, CONTEXT_OFFSET_S1($a0)
    97         lw $s2, CONTEXT_OFFSET_S2($a0)
    98         lw $s3, CONTEXT_OFFSET_S3($a0)
    99         lw $s4, CONTEXT_OFFSET_S4($a0)
    100         lw $s5, CONTEXT_OFFSET_S5($a0)
    101         lw $s6, CONTEXT_OFFSET_S6($a0)
    102         lw $s7, CONTEXT_OFFSET_S7($a0)
    103         lw $s8, CONTEXT_OFFSET_S8($a0)
    104         lw $gp, CONTEXT_OFFSET_GP($a0)
    105         lw $k1, CONTEXT_OFFSET_TLS($a0)
     95        lw $s0, __CONTEXT_OFFSET_S0($a0)
     96        lw $s1, __CONTEXT_OFFSET_S1($a0)
     97        lw $s2, __CONTEXT_OFFSET_S2($a0)
     98        lw $s3, __CONTEXT_OFFSET_S3($a0)
     99        lw $s4, __CONTEXT_OFFSET_S4($a0)
     100        lw $s5, __CONTEXT_OFFSET_S5($a0)
     101        lw $s6, __CONTEXT_OFFSET_S6($a0)
     102        lw $s7, __CONTEXT_OFFSET_S7($a0)
     103        lw $s8, __CONTEXT_OFFSET_S8($a0)
     104        lw $gp, __CONTEXT_OFFSET_GP($a0)
     105        lw $k1, __CONTEXT_OFFSET_TLS($a0)
    106106
    107107#ifdef CONFIG_FPU
    108         lw $t0, CONTEXT_OFFSET_F20($a0)
     108        lw $t0, __CONTEXT_OFFSET_F20($a0)
    109109        mtc1 $t0, $20
    110110
    111         lw $t0, CONTEXT_OFFSET_F21($a0)
     111        lw $t0, __CONTEXT_OFFSET_F21($a0)
    112112        mtc1 $t0, $21
    113113
    114         lw $t0, CONTEXT_OFFSET_F22($a0)
     114        lw $t0, __CONTEXT_OFFSET_F22($a0)
    115115        mtc1 $t0, $22
    116116
    117         lw $t0, CONTEXT_OFFSET_F23($a0)
     117        lw $t0, __CONTEXT_OFFSET_F23($a0)
    118118        mtc1 $t0, $23
    119119
    120         lw $t0, CONTEXT_OFFSET_F24($a0)
     120        lw $t0, __CONTEXT_OFFSET_F24($a0)
    121121        mtc1 $t0, $24
    122122
    123         lw $t0, CONTEXT_OFFSET_F25($a0)
     123        lw $t0, __CONTEXT_OFFSET_F25($a0)
    124124        mtc1 $t0, $25
    125125
    126         lw $t0, CONTEXT_OFFSET_F26($a0)
     126        lw $t0, __CONTEXT_OFFSET_F26($a0)
    127127        mtc1 $t0, $26
    128128
    129         lw $t0, CONTEXT_OFFSET_F27($a0)
     129        lw $t0, __CONTEXT_OFFSET_F27($a0)
    130130        mtc1 $t0, $27
    131131
    132         lw $t0, CONTEXT_OFFSET_F28($a0)
     132        lw $t0, __CONTEXT_OFFSET_F28($a0)
    133133        mtc1 $t0, $28
    134134
    135         lw $t0, CONTEXT_OFFSET_F29($a0)
     135        lw $t0, __CONTEXT_OFFSET_F29($a0)
    136136        mtc1 $t0, $29
    137137
    138         lw $t0, CONTEXT_OFFSET_F30($a0)
     138        lw $t0, __CONTEXT_OFFSET_F30($a0)
    139139        mtc1 $t0, $30
    140140#endif /* CONFIG_FPU */
    141141
    142         lw $ra, CONTEXT_OFFSET_PC($a0)
    143         lw $sp, CONTEXT_OFFSET_SP($a0)
     142        lw $ra, __CONTEXT_OFFSET_PC($a0)
     143        lw $sp, __CONTEXT_OFFSET_SP($a0)
    144144
    145145        # Just for the jump into first function,
  • uspace/lib/c/arch/ppc32/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x04
    34 #define CONTEXT_OFFSET_TLS  0x08
    35 #define CONTEXT_OFFSET_R13  0x0c
    36 #define CONTEXT_OFFSET_R14  0x10
    37 #define CONTEXT_OFFSET_R15  0x14
    38 #define CONTEXT_OFFSET_R16  0x18
    39 #define CONTEXT_OFFSET_R17  0x1c
    40 #define CONTEXT_OFFSET_R18  0x20
    41 #define CONTEXT_OFFSET_R19  0x24
    42 #define CONTEXT_OFFSET_R20  0x28
    43 #define CONTEXT_OFFSET_R21  0x2c
    44 #define CONTEXT_OFFSET_R22  0x30
    45 #define CONTEXT_OFFSET_R23  0x34
    46 #define CONTEXT_OFFSET_R24  0x38
    47 #define CONTEXT_OFFSET_R25  0x3c
    48 #define CONTEXT_OFFSET_R26  0x40
    49 #define CONTEXT_OFFSET_R27  0x44
    50 #define CONTEXT_OFFSET_R28  0x48
    51 #define CONTEXT_OFFSET_R29  0x4c
    52 #define CONTEXT_OFFSET_R30  0x50
    53 #define CONTEXT_OFFSET_R31  0x54
    54 #define CONTEXT_OFFSET_CR   0x58
    55 #define CONTEXT_SIZE        0x5c
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x04
     34#define __CONTEXT_OFFSET_TLS  0x08
     35#define __CONTEXT_OFFSET_R13  0x0c
     36#define __CONTEXT_OFFSET_R14  0x10
     37#define __CONTEXT_OFFSET_R15  0x14
     38#define __CONTEXT_OFFSET_R16  0x18
     39#define __CONTEXT_OFFSET_R17  0x1c
     40#define __CONTEXT_OFFSET_R18  0x20
     41#define __CONTEXT_OFFSET_R19  0x24
     42#define __CONTEXT_OFFSET_R20  0x28
     43#define __CONTEXT_OFFSET_R21  0x2c
     44#define __CONTEXT_OFFSET_R22  0x30
     45#define __CONTEXT_OFFSET_R23  0x34
     46#define __CONTEXT_OFFSET_R24  0x38
     47#define __CONTEXT_OFFSET_R25  0x3c
     48#define __CONTEXT_OFFSET_R26  0x40
     49#define __CONTEXT_OFFSET_R27  0x44
     50#define __CONTEXT_OFFSET_R28  0x48
     51#define __CONTEXT_OFFSET_R29  0x4c
     52#define __CONTEXT_OFFSET_R30  0x50
     53#define __CONTEXT_OFFSET_R31  0x54
     54#define __CONTEXT_OFFSET_CR   0x58
     55#define __CONTEXT_SIZE        0x5c
    5656
    5757#ifndef __ASSEMBLER__
     
    6060#include <stdint.h>
    6161
    62 typedef struct context {
     62typedef struct __context {
    6363        uint32_t sp;
    6464        uint32_t pc;
     
    8484        uint32_t r31;
    8585        uint32_t cr;
    86 } context_t;
     86} __context_t;
    8787
    8888#endif
  • uspace/lib/c/arch/ppc32/src/fibril.S

    r67ca359 ra5c78a18  
    3434
    3535FUNCTION_BEGIN(__setjmp)
    36         stw sp, CONTEXT_OFFSET_SP(r3)
    37         stw r2, CONTEXT_OFFSET_TLS(r3)
    38         stw r13, CONTEXT_OFFSET_R13(r3)
    39         stw r14, CONTEXT_OFFSET_R14(r3)
    40         stw r15, CONTEXT_OFFSET_R15(r3)
    41         stw r16, CONTEXT_OFFSET_R16(r3)
    42         stw r17, CONTEXT_OFFSET_R17(r3)
    43         stw r18, CONTEXT_OFFSET_R18(r3)
    44         stw r19, CONTEXT_OFFSET_R19(r3)
    45         stw r20, CONTEXT_OFFSET_R20(r3)
    46         stw r21, CONTEXT_OFFSET_R21(r3)
    47         stw r22, CONTEXT_OFFSET_R22(r3)
    48         stw r23, CONTEXT_OFFSET_R23(r3)
    49         stw r24, CONTEXT_OFFSET_R24(r3)
    50         stw r25, CONTEXT_OFFSET_R25(r3)
    51         stw r26, CONTEXT_OFFSET_R26(r3)
    52         stw r27, CONTEXT_OFFSET_R27(r3)
    53         stw r28, CONTEXT_OFFSET_R28(r3)
    54         stw r29, CONTEXT_OFFSET_R29(r3)
    55         stw r30, CONTEXT_OFFSET_R30(r3)
    56         stw r31, CONTEXT_OFFSET_R31(r3)
     36        stw sp, __CONTEXT_OFFSET_SP(r3)
     37        stw r2, __CONTEXT_OFFSET_TLS(r3)
     38        stw r13, __CONTEXT_OFFSET_R13(r3)
     39        stw r14, __CONTEXT_OFFSET_R14(r3)
     40        stw r15, __CONTEXT_OFFSET_R15(r3)
     41        stw r16, __CONTEXT_OFFSET_R16(r3)
     42        stw r17, __CONTEXT_OFFSET_R17(r3)
     43        stw r18, __CONTEXT_OFFSET_R18(r3)
     44        stw r19, __CONTEXT_OFFSET_R19(r3)
     45        stw r20, __CONTEXT_OFFSET_R20(r3)
     46        stw r21, __CONTEXT_OFFSET_R21(r3)
     47        stw r22, __CONTEXT_OFFSET_R22(r3)
     48        stw r23, __CONTEXT_OFFSET_R23(r3)
     49        stw r24, __CONTEXT_OFFSET_R24(r3)
     50        stw r25, __CONTEXT_OFFSET_R25(r3)
     51        stw r26, __CONTEXT_OFFSET_R26(r3)
     52        stw r27, __CONTEXT_OFFSET_R27(r3)
     53        stw r28, __CONTEXT_OFFSET_R28(r3)
     54        stw r29, __CONTEXT_OFFSET_R29(r3)
     55        stw r30, __CONTEXT_OFFSET_R30(r3)
     56        stw r31, __CONTEXT_OFFSET_R31(r3)
    5757
    5858        mflr r4
    59         stw r4, CONTEXT_OFFSET_PC(r3)
     59        stw r4, __CONTEXT_OFFSET_PC(r3)
    6060
    6161        mfcr r4
    62         stw r4, CONTEXT_OFFSET_CR(r3)
     62        stw r4, __CONTEXT_OFFSET_CR(r3)
    6363
    6464        # __setjmp returns 0
     
    6868
    6969FUNCTION_BEGIN(__longjmp)
    70         lwz sp, CONTEXT_OFFSET_SP(r3)
    71         lwz r2, CONTEXT_OFFSET_TLS(r3)
    72         lwz r13, CONTEXT_OFFSET_R13(r3)
    73         lwz r14, CONTEXT_OFFSET_R14(r3)
    74         lwz r15, CONTEXT_OFFSET_R15(r3)
    75         lwz r16, CONTEXT_OFFSET_R16(r3)
    76         lwz r17, CONTEXT_OFFSET_R17(r3)
    77         lwz r18, CONTEXT_OFFSET_R18(r3)
    78         lwz r19, CONTEXT_OFFSET_R19(r3)
    79         lwz r20, CONTEXT_OFFSET_R20(r3)
    80         lwz r21, CONTEXT_OFFSET_R21(r3)
    81         lwz r22, CONTEXT_OFFSET_R22(r3)
    82         lwz r23, CONTEXT_OFFSET_R23(r3)
    83         lwz r24, CONTEXT_OFFSET_R24(r3)
    84         lwz r25, CONTEXT_OFFSET_R25(r3)
    85         lwz r26, CONTEXT_OFFSET_R26(r3)
    86         lwz r27, CONTEXT_OFFSET_R27(r3)
    87         lwz r28, CONTEXT_OFFSET_R28(r3)
    88         lwz r29, CONTEXT_OFFSET_R29(r3)
    89         lwz r30, CONTEXT_OFFSET_R30(r3)
    90         lwz r31, CONTEXT_OFFSET_R31(r3)
     70        lwz sp, __CONTEXT_OFFSET_SP(r3)
     71        lwz r2, __CONTEXT_OFFSET_TLS(r3)
     72        lwz r13, __CONTEXT_OFFSET_R13(r3)
     73        lwz r14, __CONTEXT_OFFSET_R14(r3)
     74        lwz r15, __CONTEXT_OFFSET_R15(r3)
     75        lwz r16, __CONTEXT_OFFSET_R16(r3)
     76        lwz r17, __CONTEXT_OFFSET_R17(r3)
     77        lwz r18, __CONTEXT_OFFSET_R18(r3)
     78        lwz r19, __CONTEXT_OFFSET_R19(r3)
     79        lwz r20, __CONTEXT_OFFSET_R20(r3)
     80        lwz r21, __CONTEXT_OFFSET_R21(r3)
     81        lwz r22, __CONTEXT_OFFSET_R22(r3)
     82        lwz r23, __CONTEXT_OFFSET_R23(r3)
     83        lwz r24, __CONTEXT_OFFSET_R24(r3)
     84        lwz r25, __CONTEXT_OFFSET_R25(r3)
     85        lwz r26, __CONTEXT_OFFSET_R26(r3)
     86        lwz r27, __CONTEXT_OFFSET_R27(r3)
     87        lwz r28, __CONTEXT_OFFSET_R28(r3)
     88        lwz r29, __CONTEXT_OFFSET_R29(r3)
     89        lwz r30, __CONTEXT_OFFSET_R30(r3)
     90        lwz r31, __CONTEXT_OFFSET_R31(r3)
    9191
    92         lwz r5, CONTEXT_OFFSET_CR(r3)
     92        lwz r5, __CONTEXT_OFFSET_CR(r3)
    9393        mtcr r5
    9494
    95         lwz r5, CONTEXT_OFFSET_PC(r3)
     95        lwz r5, __CONTEXT_OFFSET_PC(r3)
    9696        mtlr r5
    9797
  • uspace/lib/c/arch/riscv64/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP   0x00
    33 #define CONTEXT_OFFSET_PC   0x08
    34 #define CONTEXT_OFFSET_ZERO 0x10
    35 #define CONTEXT_OFFSET_RA   0x18
    36 #define CONTEXT_OFFSET_X3   0x20
    37 #define CONTEXT_OFFSET_X4   0x28
    38 #define CONTEXT_OFFSET_X5   0x30
    39 #define CONTEXT_OFFSET_X6   0x38
    40 #define CONTEXT_OFFSET_X7   0x40
    41 #define CONTEXT_OFFSET_X8   0x48
    42 #define CONTEXT_OFFSET_X9   0x50
    43 #define CONTEXT_OFFSET_X10  0x58
    44 #define CONTEXT_OFFSET_X11  0x60
    45 #define CONTEXT_OFFSET_X12  0x68
    46 #define CONTEXT_OFFSET_X13  0x70
    47 #define CONTEXT_OFFSET_X14  0x78
    48 #define CONTEXT_OFFSET_X15  0x80
    49 #define CONTEXT_OFFSET_X16  0x88
    50 #define CONTEXT_OFFSET_X17  0x90
    51 #define CONTEXT_OFFSET_X18  0x98
    52 #define CONTEXT_OFFSET_X19  0xa0
    53 #define CONTEXT_OFFSET_X20  0xa8
    54 #define CONTEXT_OFFSET_X21  0xb0
    55 #define CONTEXT_OFFSET_X22  0xb8
    56 #define CONTEXT_OFFSET_X23  0xc0
    57 #define CONTEXT_OFFSET_X24  0xc8
    58 #define CONTEXT_OFFSET_X25  0xd0
    59 #define CONTEXT_OFFSET_X26  0xd8
    60 #define CONTEXT_OFFSET_X27  0xe0
    61 #define CONTEXT_OFFSET_X28  0xe8
    62 #define CONTEXT_OFFSET_X29  0xf0
    63 #define CONTEXT_OFFSET_X30  0xf8
    64 #define CONTEXT_OFFSET_X31  0x100
    65 #define CONTEXT_SIZE        0x108
     32#define __CONTEXT_OFFSET_SP   0x00
     33#define __CONTEXT_OFFSET_PC   0x08
     34#define __CONTEXT_OFFSET_ZERO 0x10
     35#define __CONTEXT_OFFSET_RA   0x18
     36#define __CONTEXT_OFFSET_X3   0x20
     37#define __CONTEXT_OFFSET_X4   0x28
     38#define __CONTEXT_OFFSET_X5   0x30
     39#define __CONTEXT_OFFSET_X6   0x38
     40#define __CONTEXT_OFFSET_X7   0x40
     41#define __CONTEXT_OFFSET_X8   0x48
     42#define __CONTEXT_OFFSET_X9   0x50
     43#define __CONTEXT_OFFSET_X10  0x58
     44#define __CONTEXT_OFFSET_X11  0x60
     45#define __CONTEXT_OFFSET_X12  0x68
     46#define __CONTEXT_OFFSET_X13  0x70
     47#define __CONTEXT_OFFSET_X14  0x78
     48#define __CONTEXT_OFFSET_X15  0x80
     49#define __CONTEXT_OFFSET_X16  0x88
     50#define __CONTEXT_OFFSET_X17  0x90
     51#define __CONTEXT_OFFSET_X18  0x98
     52#define __CONTEXT_OFFSET_X19  0xa0
     53#define __CONTEXT_OFFSET_X20  0xa8
     54#define __CONTEXT_OFFSET_X21  0xb0
     55#define __CONTEXT_OFFSET_X22  0xb8
     56#define __CONTEXT_OFFSET_X23  0xc0
     57#define __CONTEXT_OFFSET_X24  0xc8
     58#define __CONTEXT_OFFSET_X25  0xd0
     59#define __CONTEXT_OFFSET_X26  0xd8
     60#define __CONTEXT_OFFSET_X27  0xe0
     61#define __CONTEXT_OFFSET_X28  0xe8
     62#define __CONTEXT_OFFSET_X29  0xf0
     63#define __CONTEXT_OFFSET_X30  0xf8
     64#define __CONTEXT_OFFSET_X31  0x100
     65#define __CONTEXT_SIZE        0x108
    6666
    6767#ifndef __ASSEMBLER__
     
    7575 */
    7676
    77 typedef struct context {
     77typedef struct __context {
    7878        uint64_t sp;
    7979        uint64_t pc;
     
    109109        uint64_t x30;
    110110        uint64_t x31;
    111 } context_t;
     111} __context_t;
    112112
    113113#endif
  • uspace/lib/c/arch/riscv64/src/fibril.c

    r67ca359 ra5c78a18  
    3333#include <stdbool.h>
    3434
    35 int __setjmp(context_t *ctx)
     35int __setjmp(__context_t *ctx)
    3636{
    3737        return 0;
    3838}
    3939
    40 void __longjmp(context_t *ctx, int ret)
     40void __longjmp(__context_t *ctx, int ret)
    4141{
    4242        while (true)
  • uspace/lib/c/arch/sparc64/include/libarch/fibril_context.h

    r67ca359 ra5c78a18  
    3030#define LIBC_ARCH_FIBRIL_CONTEXT_H_
    3131
    32 #define CONTEXT_OFFSET_SP  0x00
    33 #define CONTEXT_OFFSET_PC  0x08
    34 #define CONTEXT_OFFSET_I0  0x10
    35 #define CONTEXT_OFFSET_I1  0x18
    36 #define CONTEXT_OFFSET_I2  0x20
    37 #define CONTEXT_OFFSET_I3  0x28
    38 #define CONTEXT_OFFSET_I4  0x30
    39 #define CONTEXT_OFFSET_I5  0x38
    40 #define CONTEXT_OFFSET_FP  0x40
    41 #define CONTEXT_OFFSET_I7  0x48
    42 #define CONTEXT_OFFSET_L0  0x50
    43 #define CONTEXT_OFFSET_L1  0x58
    44 #define CONTEXT_OFFSET_L2  0x60
    45 #define CONTEXT_OFFSET_L3  0x68
    46 #define CONTEXT_OFFSET_L4  0x70
    47 #define CONTEXT_OFFSET_L5  0x78
    48 #define CONTEXT_OFFSET_L6  0x80
    49 #define CONTEXT_OFFSET_L7  0x88
    50 #define CONTEXT_OFFSET_TP  0x90
    51 #define CONTEXT_SIZE       0x98
     32#define __CONTEXT_OFFSET_SP  0x00
     33#define __CONTEXT_OFFSET_PC  0x08
     34#define __CONTEXT_OFFSET_I0  0x10
     35#define __CONTEXT_OFFSET_I1  0x18
     36#define __CONTEXT_OFFSET_I2  0x20
     37#define __CONTEXT_OFFSET_I3  0x28
     38#define __CONTEXT_OFFSET_I4  0x30
     39#define __CONTEXT_OFFSET_I5  0x38
     40#define __CONTEXT_OFFSET_FP  0x40
     41#define __CONTEXT_OFFSET_I7  0x48
     42#define __CONTEXT_OFFSET_L0  0x50
     43#define __CONTEXT_OFFSET_L1  0x58
     44#define __CONTEXT_OFFSET_L2  0x60
     45#define __CONTEXT_OFFSET_L3  0x68
     46#define __CONTEXT_OFFSET_L4  0x70
     47#define __CONTEXT_OFFSET_L5  0x78
     48#define __CONTEXT_OFFSET_L6  0x80
     49#define __CONTEXT_OFFSET_L7  0x88
     50#define __CONTEXT_OFFSET_TP  0x90
     51#define __CONTEXT_SIZE       0x98
    5252
    5353#ifndef __ASSEMBLER__
     
    5656#include <stdint.h>
    5757
    58 typedef struct context {
     58typedef struct __context {
    5959        uintptr_t sp;  // %o6
    6060        uintptr_t pc;  // %o7
     
    7676        uint64_t l7;
    7777        uint64_t tp;  // %g7
    78 } context_t;
     78} __context_t;
    7979
    8080#endif
  • uspace/lib/c/arch/sparc64/src/fibril.S

    r67ca359 ra5c78a18  
    3737        # should a thread switch occur.
    3838        #
    39         stx %sp, [%o0 + CONTEXT_OFFSET_SP]
    40         stx %o7, [%o0 + CONTEXT_OFFSET_PC]
    41         stx %i0, [%o0 + CONTEXT_OFFSET_I0]
    42         stx %i1, [%o0 + CONTEXT_OFFSET_I1]
    43         stx %i2, [%o0 + CONTEXT_OFFSET_I2]
    44         stx %i3, [%o0 + CONTEXT_OFFSET_I3]
    45         stx %i4, [%o0 + CONTEXT_OFFSET_I4]
    46         stx %i5, [%o0 + CONTEXT_OFFSET_I5]
    47         stx %fp, [%o0 + CONTEXT_OFFSET_FP]
    48         stx %i7, [%o0 + CONTEXT_OFFSET_I7]
    49         stx %l0, [%o0 + CONTEXT_OFFSET_L0]
    50         stx %l1, [%o0 + CONTEXT_OFFSET_L1]
    51         stx %l2, [%o0 + CONTEXT_OFFSET_L2]
    52         stx %l3, [%o0 + CONTEXT_OFFSET_L3]
    53         stx %l4, [%o0 + CONTEXT_OFFSET_L4]
    54         stx %l5, [%o0 + CONTEXT_OFFSET_L5]
    55         stx %l6, [%o0 + CONTEXT_OFFSET_L6]
    56         stx %l7, [%o0 + CONTEXT_OFFSET_L7]
    57         stx %g7, [%o0 + CONTEXT_OFFSET_TP]
     39        stx %sp, [%o0 + __CONTEXT_OFFSET_SP]
     40        stx %o7, [%o0 + __CONTEXT_OFFSET_PC]
     41        stx %i0, [%o0 + __CONTEXT_OFFSET_I0]
     42        stx %i1, [%o0 + __CONTEXT_OFFSET_I1]
     43        stx %i2, [%o0 + __CONTEXT_OFFSET_I2]
     44        stx %i3, [%o0 + __CONTEXT_OFFSET_I3]
     45        stx %i4, [%o0 + __CONTEXT_OFFSET_I4]
     46        stx %i5, [%o0 + __CONTEXT_OFFSET_I5]
     47        stx %fp, [%o0 + __CONTEXT_OFFSET_FP]
     48        stx %i7, [%o0 + __CONTEXT_OFFSET_I7]
     49        stx %l0, [%o0 + __CONTEXT_OFFSET_L0]
     50        stx %l1, [%o0 + __CONTEXT_OFFSET_L1]
     51        stx %l2, [%o0 + __CONTEXT_OFFSET_L2]
     52        stx %l3, [%o0 + __CONTEXT_OFFSET_L3]
     53        stx %l4, [%o0 + __CONTEXT_OFFSET_L4]
     54        stx %l5, [%o0 + __CONTEXT_OFFSET_L5]
     55        stx %l6, [%o0 + __CONTEXT_OFFSET_L6]
     56        stx %l7, [%o0 + __CONTEXT_OFFSET_L7]
     57        stx %g7, [%o0 + __CONTEXT_OFFSET_TP]
    5858        retl
    5959        mov 0, %o0              ! __setjmp returns 0
     
    6969        flushw
    7070
    71         ldx [%o0 + CONTEXT_OFFSET_SP], %sp
    72         ldx [%o0 + CONTEXT_OFFSET_PC], %o7
    73         ldx [%o0 + CONTEXT_OFFSET_I0], %i0
    74         ldx [%o0 + CONTEXT_OFFSET_I1], %i1
    75         ldx [%o0 + CONTEXT_OFFSET_I2], %i2
    76         ldx [%o0 + CONTEXT_OFFSET_I3], %i3
    77         ldx [%o0 + CONTEXT_OFFSET_I4], %i4
    78         ldx [%o0 + CONTEXT_OFFSET_I5], %i5
    79         ldx [%o0 + CONTEXT_OFFSET_FP], %fp
    80         ldx [%o0 + CONTEXT_OFFSET_I7], %i7
    81         ldx [%o0 + CONTEXT_OFFSET_L0], %l0
    82         ldx [%o0 + CONTEXT_OFFSET_L1], %l1
    83         ldx [%o0 + CONTEXT_OFFSET_L2], %l2
    84         ldx [%o0 + CONTEXT_OFFSET_L3], %l3
    85         ldx [%o0 + CONTEXT_OFFSET_L4], %l4
    86         ldx [%o0 + CONTEXT_OFFSET_L5], %l5
    87         ldx [%o0 + CONTEXT_OFFSET_L6], %l6
    88         ldx [%o0 + CONTEXT_OFFSET_L7], %l7
    89         ldx [%o0 + CONTEXT_OFFSET_TP], %g7
     71        ldx [%o0 + __CONTEXT_OFFSET_SP], %sp
     72        ldx [%o0 + __CONTEXT_OFFSET_PC], %o7
     73        ldx [%o0 + __CONTEXT_OFFSET_I0], %i0
     74        ldx [%o0 + __CONTEXT_OFFSET_I1], %i1
     75        ldx [%o0 + __CONTEXT_OFFSET_I2], %i2
     76        ldx [%o0 + __CONTEXT_OFFSET_I3], %i3
     77        ldx [%o0 + __CONTEXT_OFFSET_I4], %i4
     78        ldx [%o0 + __CONTEXT_OFFSET_I5], %i5
     79        ldx [%o0 + __CONTEXT_OFFSET_FP], %fp
     80        ldx [%o0 + __CONTEXT_OFFSET_I7], %i7
     81        ldx [%o0 + __CONTEXT_OFFSET_L0], %l0
     82        ldx [%o0 + __CONTEXT_OFFSET_L1], %l1
     83        ldx [%o0 + __CONTEXT_OFFSET_L2], %l2
     84        ldx [%o0 + __CONTEXT_OFFSET_L3], %l3
     85        ldx [%o0 + __CONTEXT_OFFSET_L4], %l4
     86        ldx [%o0 + __CONTEXT_OFFSET_L5], %l5
     87        ldx [%o0 + __CONTEXT_OFFSET_L6], %l6
     88        ldx [%o0 + __CONTEXT_OFFSET_L7], %l7
     89        ldx [%o0 + __CONTEXT_OFFSET_TP], %g7
    9090        retl
    9191        mov %o1, %o0    ! __longjmp returns second argument
  • uspace/lib/c/include/context.h

    r67ca359 ra5c78a18  
    3333#include <libarch/fibril_context.h>
    3434
     35typedef __context_t context_t;
     36
    3537/* Context initialization data. */
    3638typedef struct {
  • uspace/lib/c/include/setjmp.h

    r67ca359 ra5c78a18  
    4141#include <_bits/__noreturn.h>
    4242
    43 typedef context_t jmp_buf[1];
     43typedef __context_t jmp_buf[1];
    4444
    4545extern int __setjmp(jmp_buf) __attribute__((returns_twice));
Note: See TracChangeset for help on using the changeset viewer.