Changeset a5c78a18 in mainline for uspace/lib/c/arch/sparc64


Ignore:
Timestamp:
2019-02-03T14:35:44Z (6 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/arch/sparc64
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.