Changeset a35b458 in mainline for uspace/lib/c/arch


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 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:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

Location:
uspace/lib/c/arch
Files:
43 edited

Legend:

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

    r3061bc1 ra35b458  
    4949                return true;
    5050        }
    51        
     51
    5252        return false;
    5353}
     
    5757        /* On real hardware the increment has to be done
    5858           as an atomic action. */
    59        
     59
    6060        val->count++;
    6161}
     
    6565        /* On real hardware the decrement has to be done
    6666           as an atomic action. */
    67        
     67
    6868        val->count++;
    6969}
     
    7474           value and the increment have to be done as a single
    7575           atomic action. */
    76        
     76
    7777        atomic_count_t prev = val->count;
    78        
     78
    7979        val->count++;
    8080        return prev;
     
    8686           value and the decrement have to be done as a single
    8787           atomic action. */
    88        
     88
    8989        atomic_count_t prev = val->count;
    90        
     90
    9191        val->count--;
    9292        return prev;
  • uspace/lib/c/arch/amd64/include/libarch/atomic.h

    r3061bc1 ra35b458  
    7575{
    7676        atomic_count_t r = 1;
    77        
     77
    7878#ifdef __PCC__
    7979        asm volatile (
     
    8989        );
    9090#endif
    91        
     91
    9292        return r;
    9393}
     
    9696{
    9797        atomic_count_t r = -1;
    98        
     98
    9999#ifdef __PCC__
    100100        asm volatile (
     
    110110        );
    111111#endif
    112        
     112
    113113        return r;
    114114}
  • uspace/lib/c/arch/amd64/src/entry.S

    r3061bc1 ra35b458  
    4444        pushq $0
    4545        movq %rsp, %rbp
    46        
     46
    4747        # %rdi was deliberately chosen as the first argument is also in %rdi
    4848        # Pass PCB pointer to __main (no operation)
  • uspace/lib/c/arch/amd64/src/entryjmp.S

    r3061bc1 ra35b458  
    3939        push %rbp
    4040        movq %rsp, %rbp
    41        
     41
    4242        # pcb must be passed in %rdi, use %rdx as a scratch register
    4343        mov %rdi, %rdx
    4444        mov %rsi, %rdi
    45        
     45
    4646        # jump to entry point
    4747        jmp *%rdx
  • uspace/lib/c/arch/amd64/src/fibril.S

    r3061bc1 ra35b458  
    3939FUNCTION_BEGIN(context_save)
    4040        movq (%rsp), %rdx     # the caller's return %eip
    41        
     41
    4242        # in %rdi is passed 1st argument
    4343        movq %rdx, CONTEXT_OFFSET_PC(%rdi)
    4444        movq %rsp, CONTEXT_OFFSET_SP(%rdi)
    45        
     45
    4646        movq %rbx, CONTEXT_OFFSET_RBX(%rdi)
    4747        movq %rbp, CONTEXT_OFFSET_RBP(%rdi)
     
    5050        movq %r14, CONTEXT_OFFSET_R14(%rdi)
    5151        movq %r15, CONTEXT_OFFSET_R15(%rdi)
    52        
     52
    5353        movq %fs:0, %rax
    5454        movq %rax, CONTEXT_OFFSET_TLS(%rdi)
    55        
     55
    5656        xorl %eax, %eax                      # context_save returns 1
    5757        incl %eax
     
    7171        movq CONTEXT_OFFSET_RBP(%rdi), %rbp
    7272        movq CONTEXT_OFFSET_RBX(%rdi), %rbx
    73        
     73
    7474        movq CONTEXT_OFFSET_SP(%rdi), %rsp   # ctx->sp -> %rsp
    75        
     75
    7676        movq CONTEXT_OFFSET_PC(%rdi), %rdx
    77        
     77
    7878        movq %rdx,(%rsp)
    79        
     79
    8080        movq CONTEXT_OFFSET_TLS(%rdi), %rdi
    8181        movq %rdi, %fs:0
    82        
     82
    8383        xorl %eax, %eax                      # context_restore returns 0
    8484        ret
  • uspace/lib/c/arch/amd64/src/syscall.S

    r3061bc1 ra35b458  
    3030
    3131.text
    32        
     32
    3333## Make a system call.
    3434#
  • uspace/lib/c/arch/amd64/src/thread_entry.S

    r3061bc1 ra35b458  
    4141        pushq $0
    4242        movq %rsp, %rbp
    43        
     43
    4444        #
    4545        # RAX contains address of uarg
  • uspace/lib/c/arch/arm32/include/libarch/atomic.h

    r3061bc1 ra35b458  
    4949{
    5050        atomic_count_t ret = 0;
    51        
     51
    5252        /*
    5353         * The following instructions between labels 1 and 2 constitute a
     
    7575                : "memory"
    7676        );
    77        
     77
    7878        ras_page[0] = 0;
    7979        asm volatile (
     
    8181        );
    8282        ras_page[1] = 0xffffffff;
    83        
     83
    8484        return ret != 0;
    8585}
     
    9696{
    9797        atomic_count_t ret = 0;
    98        
     98
    9999        /*
    100100         * The following instructions between labels 1 and 2 constitute a
     
    118118                : [imm] "r" (i)
    119119        );
    120        
     120
    121121        ras_page[0] = 0;
    122122        asm volatile (
     
    124124        );
    125125        ras_page[1] = 0xffffffff;
    126        
     126
    127127        return ret;
    128128}
  • uspace/lib/c/arch/arm32/src/entry.S

    r3061bc1 ra35b458  
    4242        ldr r0, =ras_page
    4343        str r2, [r0]
    44        
     44
    4545        #
    4646        # Create the first stack frame.
     
    5050        push {fp, ip, lr, pc}
    5151        sub fp, ip, #4
    52        
     52
    5353        # Pass pcb_ptr to __main as the first argument (in r0)
    5454        mov r0, r1
  • uspace/lib/c/arch/arm32/src/fibril.S

    r3061bc1 ra35b458  
    3434        stmia r0!, {sp, lr}
    3535        stmia r0!, {r4-r11}
    36        
     36
    3737        # return 1
    3838        mov r0, #1
     
    4343        ldmia r0!, {sp, lr}
    4444        ldmia r0!, {r4-r11}
    45        
     45
    4646        # return 0
    4747        mov r0, #0
  • uspace/lib/c/arch/arm32/src/syscall.c

    r3061bc1 ra35b458  
    6060        register sysarg_t __arm_reg_r5 asm("r5") = p6;
    6161        register sysarg_t __arm_reg_r6 asm("r6") = id;
    62        
     62
    6363        asm volatile (
    6464                "swi 0"
     
    7272                  "r" (__arm_reg_r6)
    7373        );
    74        
     74
    7575        return __arm_reg_r0;
    7676}
  • uspace/lib/c/arch/arm32/src/thread_entry.S

    r3061bc1 ra35b458  
    4242        push {fp, ip, lr, pc}
    4343        sub fp, ip, #4
    44        
     44
    4545        b __thread_main
  • uspace/lib/c/arch/ia32/include/libarch/atomic.h

    r3061bc1 ra35b458  
    7373{
    7474        atomic_count_t r = 1;
    75        
     75
    7676#ifdef __PCC__
    7777        asm volatile (
     
    8787        );
    8888#endif
    89        
     89
    9090        return r;
    9191}
     
    9494{
    9595        atomic_count_t r = -1;
    96        
     96
    9797#ifdef __PCC__
    9898        asm volatile (
     
    108108        );
    109109#endif
    110        
     110
    111111        return r;
    112112}
  • uspace/lib/c/arch/ia32/include/libarch/ddi.h

    r3061bc1 ra35b458  
    4242        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    4343                uint8_t val;
    44                
     44
    4545                asm volatile (
    4646                        "inb %w[port], %b[val]\n"
     
    4848                        : [port] "d" (port)
    4949                );
    50                
     50
    5151                return val;
    5252        } else
     
    5858        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    5959                uint16_t val;
    60                
     60
    6161                asm volatile (
    6262                        "inw %w[port], %w[val]\n"
     
    6464                        : [port] "d" (port)
    6565                );
    66                
     66
    6767                return val;
    6868        } else
     
    7474        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    7575                uint32_t val;
    76                
     76
    7777                asm volatile (
    7878                        "inl %w[port], %[val]\n"
     
    8080                        : [port] "d" (port)
    8181                );
    82                
     82
    8383                return val;
    8484        } else
  • uspace/lib/c/arch/ia32/include/libarch/tls.h

    r3061bc1 ra35b458  
    5454{
    5555        void *retval;
    56        
     56
    5757        asm volatile ("movl %%gs:0, %0" : "=r" (retval));
    58        
     58
    5959        return retval;
    6060}
  • uspace/lib/c/arch/ia32/src/entry.S

    r3061bc1 ra35b458  
    4646        mov %ax, %fs
    4747        # Do not set %gs, it contains descriptor that can see TLS
    48        
     48
    4949#ifndef PROCESSOR_i486
    5050        # Detect the mechanism used for making syscalls
     
    5757        0:
    5858#endif
    59        
     59
    6060        #
    6161        # Create the first stack frame.
     
    6464        pushl $0
    6565        movl %esp, %ebp
    66        
     66
    6767        # Pass the PCB pointer to __main as the first argument
    6868        pushl %edi
  • uspace/lib/c/arch/ia32/src/entryjmp.S

    r3061bc1 ra35b458  
    3636        push %ebp
    3737        movl %esp, %ebp
    38        
     38
    3939        # %eax := entry_point
    4040        movl 0x8(%ebp), %eax
    41        
     41
    4242        # %edi := pcb
    4343        # pcb is passed to the entry point in %edi
    4444        mov 0xc(%ebp), %edi
    45        
     45
    4646        # Save a tiny bit of stack space
    4747        pop %ebp
    48        
     48
    4949        jmp *%eax
  • uspace/lib/c/arch/ia32/src/fibril.S

    r3061bc1 ra35b458  
    4040        movl 0(%esp), %eax  # the caller's return %eip
    4141        movl 4(%esp), %edx  # address of the context variable to save context to
    42        
     42
    4343        # save registers to the context structure
    4444        movl %esp, CONTEXT_OFFSET_SP(%edx)      # %esp -> ctx->sp
     
    4848        movl %edi, CONTEXT_OFFSET_EDI(%edx)     # %edi -> ctx->edi
    4949        movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
    50        
     50
    5151        # save TLS
    5252        movl %gs:0, %eax
    5353        movl %eax, CONTEXT_OFFSET_TLS(%edx)     # tls -> ctx->tls
    54        
     54
    5555        xorl %eax, %eax         # context_save returns 1
    5656        incl %eax
     
    6565FUNCTION_BEGIN(context_restore)
    6666        movl 4(%esp), %eax  # address of the context variable to restore context from
    67        
     67
    6868        # restore registers from the context structure
    6969        movl CONTEXT_OFFSET_SP(%eax),%esp       # ctx->sp -> %esp
     
    7373        movl CONTEXT_OFFSET_EDI(%eax),%edi      # ctx->edi -> %edi
    7474        movl CONTEXT_OFFSET_EBP(%eax),%ebp      # ctx->ebp -> %ebp
    75        
     75
    7676        movl %edx, 0(%esp)  # ctx->pc -> saver's return %eip
    77        
     77
    7878        # set thread local storage
    7979        movl CONTEXT_OFFSET_TLS(%eax), %edx     # Set arg1 to TLS addr
    8080        movl %edx, %gs:0
    81        
     81
    8282        xorl %eax, %eax         # context_restore returns 0
    8383        ret
  • uspace/lib/c/arch/ia32/src/rtld/reloc.c

    r3061bc1 ra35b458  
    6565        elf_word sym_idx;
    6666        uint32_t sym_addr;
    67        
     67
    6868        elf_symbol_t *sym_table;
    6969        elf_symbol_t *sym;
     
    7171        uint32_t sym_size;
    7272        char *str_tab;
    73        
     73
    7474        elf_symbol_t *sym_def;
    7575        module_t *dest;
     
    8282
    8383        DPRINTF("address: 0x%" PRIxPTR ", entries: %zd\n", (uintptr_t)rt, rt_entries);
    84        
     84
    8585        for (i = 0; i < rt_entries; ++i) {
    8686//              DPRINTF("symbol %d: ", i);
     
    173173                        memcpy(r_ptr, (const void *)sym_addr, sym_size);
    174174                        break;
    175                        
     175
    176176                case R_386_RELATIVE:
    177177                        DPRINTF("fixup R_386_RELATIVE (b+a)\n");
  • uspace/lib/c/arch/ia32/src/thread_entry.S

    r3061bc1 ra35b458  
    4040        mov %dx, %fs
    4141        # Do not set %gs, it contains descriptor that can see TLS
    42        
     42
    4343        #
    4444        # Create the first stack frame.
     
    4747        pushl $0
    4848        mov %esp, %ebp
    49        
     49
    5050        #
    5151        # EAX contains address of uarg.
     
    5353        pushl %eax
    5454        call __thread_main
    55        
     55
    5656        #
    5757        # Not reached.
  • uspace/lib/c/arch/ia64/include/libarch/atomic.h

    r3061bc1 ra35b458  
    4343{
    4444        atomic_count_t v;
    45        
     45
    4646        asm volatile (
    4747                "fetchadd8.rel %[v] = %[count], 1\n"
     
    5454{
    5555        atomic_count_t v;
    56        
     56
    5757        asm volatile (
    5858                "fetchadd8.rel %[v] = %[count], -1\n"
     
    6565{
    6666        atomic_count_t v;
    67        
     67
    6868        asm volatile (
    6969                "fetchadd8.rel %[v] = %[count], 1\n"
     
    7171                  [count] "+m" (val->count)
    7272        );
    73        
     73
    7474        return (v + 1);
    7575}
     
    7878{
    7979        atomic_count_t v;
    80        
     80
    8181        asm volatile (
    8282                "fetchadd8.rel %[v] = %[count], -1\n"
     
    8484                  [count] "+m" (val->count)
    8585        );
    86        
     86
    8787        return (v - 1);
    8888}
     
    9191{
    9292        atomic_count_t v;
    93        
     93
    9494        asm volatile (
    9595                "fetchadd8.rel %[v] = %[count], 1\n"
     
    9797                  [count] "+m" (val->count)
    9898        );
    99        
     99
    100100        return v;
    101101}
     
    104104{
    105105        atomic_count_t v;
    106        
     106
    107107        asm volatile (
    108108                "fetchadd8.rel %[v] = %[count], -1\n"
     
    110110                  [count] "+m" (val->count)
    111111        );
    112        
     112
    113113        return v;
    114114}
  • uspace/lib/c/arch/ia64/src/ddi.c

    r3061bc1 ra35b458  
    3636        if (sysinfo_get_value("ia64_iospace.address.virtual", &addr) != 0)
    3737                addr = 0;
    38        
     38
    3939        return addr;
    4040}
  • uspace/lib/c/arch/ia64/src/entry.S

    r3061bc1 ra35b458  
    4040        alloc loc0 = ar.pfs, 0, 1, 2, 0
    4141        movl gp = __gp
    42        
     42
    4343        # Pass PCB pointer as the first argument to __main
    4444        mov out0 = r2 ;;
  • uspace/lib/c/arch/ia64/src/fibril.S

    r3061bc1 ra35b458  
    4545        flushrs
    4646        mov loc4 = ar.bsp
    47        
     47
    4848        /*
    4949         * Put RSE to enforced lazy mode.
     
    117117
    118118        mov loc2 = ar.unat
    119        
     119
    120120        /*
    121121         * Save application registers
     
    177177
    178178        mov ar.unat = loc1
    179        
     179
    180180        add r8 = r0, r0, 1      /* context_save returns 1 */
    181181        br.ret.sptk.many b0
     
    239239        ld8 loc5 = [loc14]      /* load ar.rnat */
    240240        ld8 loc6 = [loc15]      /* load ar.lc */
    241        
     241
    242242        .auto
    243243
     
    274274        mov ar.unat = loc2 ;;
    275275        mov ar.lc = loc6
    276        
     276
    277277        /*
    278278         * Restore general registers including NaT bits
     
    332332        ldf.fill f30 = [loc48]
    333333        ldf.fill f31 = [loc49]
    334        
     334
    335335        mov ar.unat = loc1
    336        
     336
    337337        mov r8 = r0                     /* context_restore returns 0 */
    338338        br.ret.sptk.many b0
  • uspace/lib/c/arch/ia64/src/thread_entry.S

    r3061bc1 ra35b458  
    3838
    3939        movl gp = __gp
    40        
     40
    4141        #
    4242        # r8 contains address of uarg structure.
    4343        #
    44        
     44
    4545        mov out0 = r8 ;;
    4646        br.call.sptk.many b0 = __thread_main
    47        
     47
    4848        #
    4949        # Not reached.
  • uspace/lib/c/arch/mips32/include/libarch/atomic.h

    r3061bc1 ra35b458  
    6262        atomic_count_t tmp;
    6363        atomic_count_t v;
    64        
     64
    6565        asm volatile (
    6666                "1:\n"
     
    7777                  "i" (0)
    7878        );
    79        
     79
    8080        return v;
    8181}
  • uspace/lib/c/arch/mips32/src/entry.S

    r3061bc1 ra35b458  
    4444        .frame $sp, ABI_STACK_FRAME, $ra
    4545        .cpload $t9
    46        
     46
    4747        # Allocate the stack frame.
    4848        addiu $sp, -ABI_STACK_FRAME
    49        
     49
    5050        # Allow PIC code
    5151        .cprestore 16
    52        
     52
    5353        # Pass pcb_ptr to __main() as the first argument. It is already
    5454        # in $a0. As the first argument is passed in $a0, no operation
    5555        # is needed.
    56        
     56
    5757        jal __main
    5858        nop
    59        
     59
    6060        #
    6161        # Not reached.
  • uspace/lib/c/arch/mips32/src/entryjmp.S

    r3061bc1 ra35b458  
    4343        # tmp := entry_point
    4444        move $t9, $a0
    45        
     45
    4646        # Pass pcb to the entry point in $a0
    4747        move $a0, $a1
    48        
     48
    4949        jr $t9
    5050        addiu $sp, -ABI_STACK_FRAME
  • uspace/lib/c/arch/mips32/src/fibril.S

    r3061bc1 ra35b458  
    4646        sw $s8, CONTEXT_OFFSET_S8($a0)
    4747        sw $gp, CONTEXT_OFFSET_GP($a0)
    48        
     48
    4949        sw $k1, CONTEXT_OFFSET_TLS($a0)
    50        
     50
    5151#ifdef CONFIG_FPU
    5252        mfc1 $t0, $20
    5353        sw $t0, CONTEXT_OFFSET_F20($a0)
    54        
     54
    5555        mfc1 $t0, $21
    5656        sw $t0, CONTEXT_OFFSET_F21($a0)
    57        
     57
    5858        mfc1 $t0, $22
    5959        sw $t0, CONTEXT_OFFSET_F22($a0)
    60        
     60
    6161        mfc1 $t0, $23
    6262        sw $t0, CONTEXT_OFFSET_F23($a0)
    63        
     63
    6464        mfc1 $t0, $24
    6565        sw $t0, CONTEXT_OFFSET_F24($a0)
    66        
     66
    6767        mfc1 $t0, $25
    6868        sw $t0, CONTEXT_OFFSET_F25($a0)
    69        
     69
    7070        mfc1 $t0, $26
    7171        sw $t0, CONTEXT_OFFSET_F26($a0)
    72        
     72
    7373        mfc1 $t0, $27
    7474        sw $t0, CONTEXT_OFFSET_F27($a0)
    75        
     75
    7676        mfc1 $t0, $28
    7777        sw $t0, CONTEXT_OFFSET_F28($a0)
    78        
     78
    7979        mfc1 $t0, $29
    8080        sw $t0, CONTEXT_OFFSET_F29($a0)
    81        
     81
    8282        mfc1 $t0, $30
    8383        sw $t0, CONTEXT_OFFSET_F30($a0)
    8484#endif /* CONFIG_FPU */
    85        
     85
    8686        sw $ra, CONTEXT_OFFSET_PC($a0)
    8787        sw $sp, CONTEXT_OFFSET_SP($a0)
    88        
     88
    8989        # context_save returns 1
    9090        j $ra
     
    104104        lw $gp, CONTEXT_OFFSET_GP($a0)
    105105        lw $k1, CONTEXT_OFFSET_TLS($a0)
    106        
     106
    107107#ifdef CONFIG_FPU
    108108        lw $t0, CONTEXT_OFFSET_F20($a0)
    109109        mtc1 $t0, $20
    110        
     110
    111111        lw $t0, CONTEXT_OFFSET_F21($a0)
    112112        mtc1 $t0, $21
    113        
     113
    114114        lw $t0, CONTEXT_OFFSET_F22($a0)
    115115        mtc1 $t0, $22
    116        
     116
    117117        lw $t0, CONTEXT_OFFSET_F23($a0)
    118118        mtc1 $t0, $23
    119        
     119
    120120        lw $t0, CONTEXT_OFFSET_F24($a0)
    121121        mtc1 $t0, $24
    122        
     122
    123123        lw $t0, CONTEXT_OFFSET_F25($a0)
    124124        mtc1 $t0, $25
    125        
     125
    126126        lw $t0, CONTEXT_OFFSET_F26($a0)
    127127        mtc1 $t0, $26
    128        
     128
    129129        lw $t0, CONTEXT_OFFSET_F27($a0)
    130130        mtc1 $t0, $27
    131        
     131
    132132        lw $t0, CONTEXT_OFFSET_F28($a0)
    133133        mtc1 $t0, $28
    134        
     134
    135135        lw $t0, CONTEXT_OFFSET_F29($a0)
    136136        mtc1 $t0, $29
    137        
     137
    138138        lw $t0, CONTEXT_OFFSET_F30($a0)
    139139        mtc1 $t0, $30
    140140#endif /* CONFIG_FPU */
    141        
     141
    142142        lw $ra, CONTEXT_OFFSET_PC($a0)
    143143        lw $sp, CONTEXT_OFFSET_SP($a0)
    144        
     144
    145145        # Just for the jump into first function,
    146146        # but one instruction should not bother us
    147147        move $t9, $ra
    148        
     148
    149149        # context_restore returns 0
    150150        j $ra
  • uspace/lib/c/arch/mips32/src/syscall.c

    r3061bc1 ra35b458  
    4646        register sysarg_t __mips_reg_t1 asm("$9") = p6;
    4747        register sysarg_t __mips_reg_v0 asm("$2") = id;
    48        
     48
    4949        asm volatile (
    5050                "syscall\n"
     
    6363                : "%ra"
    6464        );
    65        
     65
    6666        return __mips_reg_v0;
    6767}
  • uspace/lib/c/arch/mips32/src/thread_entry.S

    r3061bc1 ra35b458  
    4343        .frame $sp, ABI_STACK_FRAME, $ra
    4444        .cpload $t9
    45        
     45
    4646        #
    4747        # v0 contains address of uarg.
    4848        #
    4949        add $a0, $v0, 0
    50        
     50
    5151        # Allocate the stack frame.
    5252        addiu $sp, -ABI_STACK_FRAME
    53        
     53
    5454        # Allow PIC code
    5555        .cprestore 16
    56        
     56
    5757        jal __thread_main
    5858        nop
    59        
     59
    6060        #
    6161        # Not reached.
  • uspace/lib/c/arch/ppc32/include/libarch/atomic.h

    r3061bc1 ra35b458  
    4343{
    4444        atomic_count_t tmp;
    45        
     45
    4646        asm volatile (
    4747                "1:\n"
     
    6161{
    6262        atomic_count_t tmp;
    63        
     63
    6464        asm volatile (
    6565                "1:\n"
  • uspace/lib/c/arch/ppc32/include/libarch/tls.h

    r3061bc1 ra35b458  
    4848        void *tp = tcb;
    4949        tp += PPC_TP_OFFSET + sizeof(tcb_t);
    50        
     50
    5151        asm volatile (
    5252                "mr %%r2, %0\n"
     
    5959{
    6060        void * retval;
    61        
     61
    6262        asm volatile (
    6363                "mr %0, %%r2\n"
  • uspace/lib/c/arch/ppc32/src/entry.S

    r3061bc1 ra35b458  
    4444        stw %r3, 0(%r1)
    4545        stwu %r1, -16(%r1)
    46        
     46
    4747        # Pass the PCB pointer to __main() as the first argument.
    4848        # The first argument is passed in r3.
  • uspace/lib/c/arch/ppc32/src/fibril.S

    r3061bc1 ra35b458  
    5555        stw r30, CONTEXT_OFFSET_R30(r3)
    5656        stw r31, CONTEXT_OFFSET_R31(r3)
    57        
     57
    5858        mflr r4
    5959        stw r4, CONTEXT_OFFSET_PC(r3)
    60        
     60
    6161        mfcr r4
    6262        stw r4, CONTEXT_OFFSET_CR(r3)
    63        
     63
    6464        # context_save returns 1
    6565        li r3, 1
     
    8989        lwz r30, CONTEXT_OFFSET_R30(r3)
    9090        lwz r31, CONTEXT_OFFSET_R31(r3)
    91        
     91
    9292        lwz r4, CONTEXT_OFFSET_CR(r3)
    9393        mtcr r4
    94        
     94
    9595        lwz r4, CONTEXT_OFFSET_PC(r3)
    9696        mtlr r4
    97        
     97
    9898        # context_restore returns 0
    9999        li r3, 0
  • uspace/lib/c/arch/ppc32/src/syscall.c

    r3061bc1 ra35b458  
    4747        register sysarg_t __ppc32_reg_r8 asm("8") = p6;
    4848        register sysarg_t __ppc32_reg_r9 asm("9") = id;
    49        
     49
    5050        asm volatile (
    5151                "sc\n"
     
    5959                  "r" (__ppc32_reg_r9)
    6060        );
    61        
     61
    6262        return __ppc32_reg_r3;
    6363}
  • uspace/lib/c/arch/ppc32/src/thread_entry.S

    r3061bc1 ra35b458  
    3030
    3131.text
    32        
     32
    3333## User-space thread entry point for all but the first threads.
    3434#
  • uspace/lib/c/arch/riscv64/include/libarch/atomic.h

    r3061bc1 ra35b458  
    5151                return true;
    5252        }
    53        
     53
    5454        return false;
    5555}
     
    5959        /* On real hardware the increment has to be done
    6060           as an atomic action. */
    61        
     61
    6262        val->count++;
    6363}
     
    6767        /* On real hardware the decrement has to be done
    6868           as an atomic action. */
    69        
     69
    7070        val->count++;
    7171}
     
    7676           value and the increment have to be done as a single
    7777           atomic action. */
    78        
     78
    7979        atomic_count_t prev = val->count;
    80        
     80
    8181        val->count++;
    8282        return prev;
     
    8888           value and the decrement have to be done as a single
    8989           atomic action. */
    90        
     90
    9191        atomic_count_t prev = val->count;
    92        
     92
    9393        val->count--;
    9494        return prev;
  • uspace/lib/c/arch/sparc64/include/libarch/atomic.h

    r3061bc1 ra35b458  
    5555        atomic_count_t a;
    5656        atomic_count_t b;
    57        
     57
    5858        do {
    5959                volatile uintptr_t ptr = (uintptr_t) &val->count;
    60                
     60
    6161                a = *((atomic_count_t *) ptr);
    6262                b = a + i;
    63                
     63
    6464                asm volatile (
    6565                        "casx %0, %2, %1\n"
     
    6969                );
    7070        } while (a != b);
    71        
     71
    7272        return a;
    7373}
  • uspace/lib/c/arch/sparc64/include/libarch/syscall.h

    r3061bc1 ra35b458  
    6666                : "memory"
    6767        );
    68        
     68
    6969        return a1;
    7070}
  • uspace/lib/c/arch/sparc64/src/entry.S

    r3061bc1 ra35b458  
    4545        flushw
    4646        add %g0, -0x7ff, %fp
    47        
     47
    4848        # Pass pcb_ptr as the first argument to __main()
    4949        mov %i1, %o0
  • uspace/lib/c/arch/sparc64/src/fibril.S

    r3061bc1 ra35b458  
    6868        #
    6969        flushw
    70        
     70
    7171        ldx [%o0 + CONTEXT_OFFSET_SP], %sp
    7272        ldx [%o0 + CONTEXT_OFFSET_PC], %o7
  • uspace/lib/c/arch/sparc64/src/thread_entry.S

    r3061bc1 ra35b458  
    3030
    3131.text
    32        
     32
    3333## User-space thread entry point for all but the first threads.
    3434#
     
    5050        call __thread_main              ! %o0 contains address of uarg
    5151        or %l7, %lo(_gp), %l7
    52        
     52
    5353        ! not reached
Note: See TracChangeset for help on using the changeset viewer.