Changeset a35b458 in mainline for kernel/arch/ia32/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/ia32/include/arch
Files:
8 edited

Legend:

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

    r3061bc1 ra35b458  
    174174        if (((void *)port) < IO_SPACE_BOUNDARY) {
    175175                uint8_t val;
    176                
     176
    177177                asm volatile (
    178178                        "inb %w[port], %b[val]\n"
     
    180180                        : [port] "d" (port)
    181181                );
    182                
     182
    183183                return val;
    184184        } else
     
    198198        if (((void *)port) < IO_SPACE_BOUNDARY) {
    199199                uint16_t val;
    200                
     200
    201201                asm volatile (
    202202                        "inw %w[port], %w[val]\n"
     
    204204                        : [port] "d" (port)
    205205                );
    206                
     206
    207207                return val;
    208208        } else
     
    222222        if (((void *)port) < IO_SPACE_BOUNDARY) {
    223223                uint32_t val;
    224                
     224
    225225                asm volatile (
    226226                        "inl %w[port], %[val]\n"
     
    228228                        : [port] "d" (port)
    229229                );
    230                
     230
    231231                return val;
    232232        } else
     
    243243                : [v] "=r" (eflags)
    244244        );
    245        
     245
    246246        return eflags;
    247247}
     
    276276{
    277277        ipl_t ipl = interrupts_read();
    278        
     278
    279279        asm volatile ("sti\n");
    280        
     280
    281281        return ipl;
    282282}
     
    292292{
    293293        ipl_t ipl = interrupts_read();
    294        
     294
    295295        asm volatile ("cli\n");
    296        
     296
    297297        return ipl;
    298298}
     
    336336{
    337337        uint32_t ax, dx;
    338        
     338
    339339        asm volatile (
    340340                "rdmsr"
     
    343343                : "c" (msr)
    344344        );
    345        
     345
    346346        return ((uint64_t) dx << 32) | ax;
    347347}
     
    360360{
    361361        uintptr_t v;
    362        
     362
    363363        asm volatile (
    364364                "andl %%esp, %[v]\n"
     
    366366                : "0" (~(STACK_SIZE - 1))
    367367        );
    368        
     368
    369369        return v;
    370370}
  • kernel/arch/ia32/include/arch/atomic.h

    r3061bc1 ra35b458  
    7575{
    7676        atomic_count_t r = 1;
    77        
     77
    7878        asm volatile (
    7979                "lock xaddl %[r], %[count]\n"
     
    8181                  [r] "+r" (r)
    8282        );
    83        
     83
    8484        return r;
    8585}
     
    8888{
    8989        atomic_count_t r = -1;
    90        
     90
    9191        asm volatile (
    9292                "lock xaddl %[r], %[count]\n"
     
    9494                  [r] "+r" (r)
    9595        );
    96        
     96
    9797        return r;
    9898}
     
    104104{
    105105        atomic_count_t v = 1;
    106        
     106
    107107        asm volatile (
    108108                "xchgl %[v], %[count]\n"
     
    110110                  [count] "+m" (val->count)
    111111        );
    112        
     112
    113113        return v;
    114114}
     
    119119{
    120120        atomic_count_t tmp;
    121        
     121
    122122        preemption_disable();
    123123        asm volatile (
     
    129129                "testl %[tmp], %[tmp]\n"
    130130                "jnz 0b\n"       /* lightweight looping on locked spinlock */
    131                
     131
    132132                "incl %[tmp]\n"  /* now use the atomic operation */
    133133                "xchgl %[count], %[tmp]\n"
     
    137137                  [tmp] "=&r" (tmp)
    138138        );
    139        
     139
    140140        /*
    141141         * Prevent critical section code from bleeding out this way up.
  • kernel/arch/ia32/include/arch/cpu.h

    r3061bc1 ra35b458  
    8080
    8181        tss_t *tss;
    82        
     82
    8383        size_t iomapver_copy;  /** Copy of TASK's I/O Permission bitmap generation count. */
    8484} cpu_arch_t;
  • kernel/arch/ia32/include/arch/cpuid.h

    r3061bc1 ra35b458  
    8383        uint32_t val;
    8484        uint32_t ret;
    85        
     85
    8686        asm volatile (
    8787                "pushf\n"                      /* read flags */
    8888                "popl %[ret]\n"
    8989                "movl %[ret], %[val]\n"
    90                
     90
    9191                "xorl %[eflags_id], %[val]\n"  /* swap the ID bit */
    92                
     92
    9393                "pushl %[val]\n"               /* propagate the change into flags */
    9494                "popf\n"
    9595                "pushf\n"
    9696                "popl %[val]\n"
    97                
     97
    9898                "andl %[eflags_id], %[ret]\n"  /* interrested only in ID bit */
    9999                "andl %[eflags_id], %[val]\n"
     
    102102                : [eflags_id] "i" (EFLAGS_ID)
    103103        );
    104        
     104
    105105        return ret;
    106106}
  • kernel/arch/ia32/include/arch/cycle.h

    r3061bc1 ra35b458  
    4444#else
    4545        uint64_t v;
    46        
     46
    4747        asm volatile(
    4848                "rdtsc\n"
    4949                : "=A" (v)
    5050        );
    51        
     51
    5252        return v;
    5353#endif
  • kernel/arch/ia32/include/arch/mm/page.h

    r3061bc1 ra35b458  
    183183{
    184184        pte_t *p = &pt[i];
    185        
     185
    186186        return ((!p->page_cache_disable) << PAGE_CACHEABLE_SHIFT |
    187187            (!p->present) << PAGE_PRESENT_SHIFT |
     
    196196{
    197197        pte_t *p = &pt[i];
    198        
     198
    199199        p->page_cache_disable = !(flags & PAGE_CACHEABLE);
    200200        p->present = !(flags & PAGE_NOT_PRESENT);
     
    202202        p->writeable = (flags & PAGE_WRITE) != 0;
    203203        p->global = (flags & PAGE_GLOBAL) != 0;
    204        
     204
    205205        /*
    206206         * Ensure that there is at least one bit set even if the present bit is
  • kernel/arch/ia32/include/arch/smp/apic.h

    r3061bc1 ra35b458  
    334334                } __attribute__ ((packed));
    335335        };
    336        
     336
    337337} __attribute__ ((packed)) io_redirection_reg_t;
    338338
  • kernel/arch/ia32/include/arch/smp/smp.h

    r3061bc1 ra35b458  
    4343        /** Check whether a processor is enabled. */
    4444        bool (*cpu_enabled)(size_t);
    45        
     45
    4646        /** Check whether a processor is BSP. */
    4747        bool (*cpu_bootstrap)(size_t);
    48        
     48
    4949        /** Return APIC ID of a processor. */
    5050        uint8_t (*cpu_apic_id)(size_t);
    51        
     51
    5252        /** Return mapping between IRQ and APIC pin. */
    5353        int (*irq_to_pin)(unsigned int);
Note: See TracChangeset for help on using the changeset viewer.