Changeset a35b458 in mainline for kernel/arch/riscv64/include


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 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:
kernel/arch/riscv64/include/arch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/riscv64/include/arch/asm.h

    r3061bc1 ra35b458  
    4545{
    4646        ipl_t ipl;
    47        
     47
    4848        asm volatile (
    4949                "csrrsi %[ipl], sstatus, " STRING(SSTATUS_SIE_MASK) "\n"
    5050                : [ipl] "=r" (ipl)
    5151        );
    52        
     52
    5353        return ipl;
    5454}
     
    5757{
    5858        ipl_t ipl;
    59        
     59
    6060        asm volatile (
    6161                "csrrci %[ipl], sstatus, " STRING(SSTATUS_SIE_MASK) "\n"
    6262                : [ipl] "=r" (ipl)
    6363        );
    64        
     64
    6565        return ipl;
    6666}
     
    7777{
    7878        ipl_t ipl;
    79        
     79
    8080        asm volatile (
    8181                "csrr %[ipl], sstatus\n"
    8282                : [ipl] "=r" (ipl)
    8383        );
    84        
     84
    8585        return ipl;
    8686}
     
    9494{
    9595        uintptr_t base;
    96        
     96
    9797        asm volatile (
    9898                "and %[base], sp, %[mask]\n"
     
    100100                : [mask] "r" (~(STACK_SIZE - 1))
    101101        );
    102        
     102
    103103        return base;
    104104}
  • kernel/arch/riscv64/include/arch/atomic.h

    r3061bc1 ra35b458  
    5959{
    6060        atomic_count_t orig;
    61        
     61
    6262        asm volatile (
    6363                "amoadd.d %[orig], %[inc], %[addr]\n"
     
    6565                : [inc] "r" (1)
    6666        );
    67        
     67
    6868        return orig;
    6969}
     
    7272{
    7373        atomic_count_t orig;
    74        
     74
    7575        asm volatile (
    7676                "amoadd.d %[orig], %[inc], %[addr]\n"
     
    7878                : [inc] "r" (-1)
    7979        );
    80        
     80
    8181        return orig;
    8282}
     
    8585{
    8686        atomic_count_t orig;
    87        
     87
    8888        asm volatile (
    8989                "amoadd.d %[orig], %[inc], %[addr]\n"
     
    9191                : [inc] "r" (1)
    9292        );
    93        
     93
    9494        return orig - 1;
    9595}
     
    9898{
    9999        atomic_count_t orig;
    100        
     100
    101101        asm volatile (
    102102                "amoadd.d %[orig], %[inc], %[addr]\n"
     
    104104                : [inc] "r" (-1)
    105105        );
    106        
     106
    107107        return orig + 1;
    108108}
  • kernel/arch/riscv64/include/arch/cycle.h

    r3061bc1 ra35b458  
    4141{
    4242        uint64_t cycle;
    43        
     43
    4444        asm volatile (
    4545                "rdcycle %[cycle]\n"
    4646                : [cycle] "=r" (cycle)
    4747        );
    48        
     48
    4949        return cycle;
    5050}
  • kernel/arch/riscv64/include/arch/mm/page.h

    r3061bc1 ra35b458  
    182182{
    183183        pte_t *entry = &pt[i];
    184        
     184
    185185        return (((!entry->valid) << PAGE_PRESENT_SHIFT) |
    186186            (entry->user << PAGE_USER_SHIFT) |
     
    194194{
    195195        pte_t *entry = &pt[i];
    196        
     196
    197197        entry->valid = !(flags & PAGE_NOT_PRESENT);
    198198        entry->readable = (flags & PAGE_READ) != 0;
Note: See TracChangeset for help on using the changeset viewer.