Changeset 1433ecda in mainline for kernel/arch/amd64


Ignore:
Timestamp:
2018-04-04T15:42:37Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

Location:
kernel/arch/amd64
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/arch/atomic.h

    r47b2d7e3 r1433ecda  
    4545#ifdef CONFIG_SMP
    4646        asm volatile (
    47                 "lock incq %[count]\n"
    48                 : [count] "+m" (val->count)
    49         );
    50 #else
    51         asm volatile (
    52                 "incq %[count]\n"
    53                 : [count] "+m" (val->count)
     47            "lock incq %[count]\n"
     48            : [count] "+m" (val->count)
     49        );
     50#else
     51        asm volatile (
     52            "incq %[count]\n"
     53            : [count] "+m" (val->count)
    5454        );
    5555#endif /* CONFIG_SMP */
     
    6060#ifdef CONFIG_SMP
    6161        asm volatile (
    62                 "lock decq %[count]\n"
    63                 : [count] "+m" (val->count)
    64         );
    65 #else
    66         asm volatile (
    67                 "decq %[count]\n"
    68                 : [count] "+m" (val->count)
     62            "lock decq %[count]\n"
     63            : [count] "+m" (val->count)
     64        );
     65#else
     66        asm volatile (
     67            "decq %[count]\n"
     68            : [count] "+m" (val->count)
    6969        );
    7070#endif /* CONFIG_SMP */
     
    7676
    7777        asm volatile (
    78                 "lock xaddq %[r], %[count]\n"
    79                 : [count] "+m" (val->count),
    80                   [r] "+r" (r)
     78            "lock xaddq %[r], %[count]\n"
     79            : [count] "+m" (val->count),
     80              [r] "+r" (r)
    8181        );
    8282
     
    8989
    9090        asm volatile (
    91                 "lock xaddq %[r], %[count]\n"
    92                 : [count] "+m" (val->count),
    93                   [r] "+r" (r)
     91            "lock xaddq %[r], %[count]\n"
     92            : [count] "+m" (val->count),
     93              [r] "+r" (r)
    9494        );
    9595
     
    105105
    106106        asm volatile (
    107                 "xchgq %[v], %[count]\n"
    108                 : [v] "+r" (v),
    109                   [count] "+m" (val->count)
     107            "xchgq %[v], %[count]\n"
     108            : [v] "+r" (v),
     109              [count] "+m" (val->count)
    110110        );
    111111
     
    120120        preemption_disable();
    121121        asm volatile (
    122                 "0:\n"
    123                 "       pause\n"
    124                 "       mov %[count], %[tmp]\n"
    125                 "       testq %[tmp], %[tmp]\n"
    126                 "       jnz 0b\n"       /* lightweight looping on locked spinlock */
    127 
    128                 "       incq %[tmp]\n"  /* now use the atomic operation */
    129                 "       xchgq %[count], %[tmp]\n"
    130                 "       testq %[tmp], %[tmp]\n"
    131                 "       jnz 0b\n"
    132                 : [count] "+m" (val->count),
    133                   [tmp] "=&r" (tmp)
     122            "0:\n"
     123            "   pause\n"
     124            "   mov %[count], %[tmp]\n"
     125            "   testq %[tmp], %[tmp]\n"
     126            "   jnz 0b\n"       /* lightweight looping on locked spinlock */
     127
     128            "   incq %[tmp]\n"  /* now use the atomic operation */
     129            "   xchgq %[count], %[tmp]\n"
     130            "   testq %[tmp], %[tmp]\n"
     131            "   jnz 0b\n"
     132            : [count] "+m" (val->count),
     133              [tmp] "=&r" (tmp)
    134134        );
    135135
  • kernel/arch/amd64/include/arch/cpuid.h

    r47b2d7e3 r1433ecda  
    5555        uint32_t cpuid_ecx;
    5656        uint32_t cpuid_edx;
    57 } __attribute__ ((packed)) cpu_info_t;
     57} __attribute__((packed)) cpu_info_t;
    5858
    5959extern int has_cpuid(void);
  • kernel/arch/amd64/include/arch/cycle.h

    r47b2d7e3 r1433ecda  
    4444
    4545        asm volatile (
    46                 "rdtsc\n"
    47                 : "=a" (lower),
    48                   "=d" (upper)
     46            "rdtsc\n"
     47            : "=a" (lower),
     48              "=d" (upper)
    4949        );
    5050
  • kernel/arch/amd64/include/arch/mm/page.h

    r47b2d7e3 r1433ecda  
    198198        unsigned int accessed : 1;
    199199        unsigned int dirty : 1;
    200         unsigned int unused: 1;
     200        unsigned int unused : 1;
    201201        unsigned int global : 1;
    202202        unsigned int soft_valid : 1;  /**< Valid content even if present bit is cleared. */
     
    205205        unsigned int addr_32_51 : 21;
    206206        unsigned int no_execute : 1;
    207 } __attribute__ ((packed)) pte_t;
     207} __attribute__((packed)) pte_t;
    208208
    209209NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
  • kernel/arch/amd64/include/arch/pm.h

    r47b2d7e3 r1433ecda  
    3737
    3838#ifndef __ASSEMBLER__
    39         #include <typedefs.h>
    40         #include <arch/context.h>
     39#include <typedefs.h>
     40#include <arch/context.h>
    4141#endif
    4242
     
    9191
    9292typedef struct {
    93         unsigned limit_0_15: 16;
    94         unsigned base_0_15: 16;
    95         unsigned base_16_23: 8;
    96         unsigned access: 8;
    97         unsigned limit_16_19: 4;
    98         unsigned available: 1;
    99         unsigned longmode: 1;
    100         unsigned special: 1;
     93        unsigned limit_0_15 : 16;
     94        unsigned base_0_15 : 16;
     95        unsigned base_16_23 : 8;
     96        unsigned access : 8;
     97        unsigned limit_16_19 : 4;
     98        unsigned available : 1;
     99        unsigned longmode : 1;
     100        unsigned special : 1;
    101101        unsigned granularity : 1;
    102         unsigned base_24_31: 8;
    103 } __attribute__ ((packed)) descriptor_t;
     102        unsigned base_24_31 : 8;
     103} __attribute__((packed)) descriptor_t;
    104104
    105105typedef struct {
    106         unsigned limit_0_15: 16;
    107         unsigned base_0_15: 16;
    108         unsigned base_16_23: 8;
    109         unsigned type: 4;
     106        unsigned limit_0_15 : 16;
     107        unsigned base_0_15 : 16;
     108        unsigned base_16_23 : 8;
     109        unsigned type : 4;
    110110        unsigned : 1;
    111111        unsigned dpl : 2;
    112112        unsigned present : 1;
    113         unsigned limit_16_19: 4;
    114         unsigned available: 1;
     113        unsigned limit_16_19 : 4;
     114        unsigned available : 1;
    115115        unsigned : 2;
    116116        unsigned granularity : 1;
    117         unsigned base_24_31: 8;
     117        unsigned base_24_31 : 8;
    118118        unsigned base_32_63 : 32;
    119119        unsigned  : 32;
    120 } __attribute__ ((packed)) tss_descriptor_t;
     120} __attribute__((packed)) tss_descriptor_t;
    121121
    122122typedef struct {
    123         unsigned offset_0_15: 16;
    124         unsigned selector: 16;
    125         unsigned ist:3;
    126         unsigned unused: 5;
    127         unsigned type: 5;
    128         unsigned dpl: 2;
     123        unsigned offset_0_15 : 16;
     124        unsigned selector : 16;
     125        unsigned ist : 3;
     126        unsigned unused : 5;
     127        unsigned type : 5;
     128        unsigned dpl : 2;
    129129        unsigned present : 1;
    130         unsigned offset_16_31: 16;
    131         unsigned offset_32_63: 32;
     130        unsigned offset_16_31 : 16;
     131        unsigned offset_32_63 : 32;
    132132        unsigned  : 32;
    133 } __attribute__ ((packed)) idescriptor_t;
     133} __attribute__((packed)) idescriptor_t;
    134134
    135135typedef struct {
    136136        uint16_t limit;
    137137        uint64_t base;
    138 } __attribute__ ((packed)) ptr_16_64_t;
     138} __attribute__((packed)) ptr_16_64_t;
    139139
    140140typedef struct {
    141141        uint16_t limit;
    142142        uint32_t base;
    143 } __attribute__ ((packed)) ptr_16_32_t;
     143} __attribute__((packed)) ptr_16_32_t;
    144144
    145145typedef struct {
     
    160160        uint16_t iomap_base;
    161161        uint8_t iomap[TSS_IOMAP_SIZE];
    162 } __attribute__ ((packed)) tss_t;
     162} __attribute__((packed)) tss_t;
    163163
    164164extern tss_t *tss_p;
  • kernel/arch/amd64/src/cpu/cpu.c

    r47b2d7e3 r1433ecda  
    136136}
    137137
    138 void cpu_print_report(cpu_t* m)
     138void cpu_print_report(cpu_t *m)
    139139{
    140140        printf("cpu%d: (%s family=%d model=%d stepping=%d apicid=%u) %dMHz\n",
  • kernel/arch/amd64/src/fpu_context.c

    r47b2d7e3 r1433ecda  
    4040{
    4141        asm volatile (
    42                 "fxsave %[fctx]\n"
    43                 : [fctx] "=m" (fctx->fpu)
     42            "fxsave %[fctx]\n"
     43            : [fctx] "=m" (fctx->fpu)
    4444        );
    4545}
     
    4949{
    5050        asm volatile (
    51                 "fxrstor %[fctx]\n"
    52                 : [fctx] "=m" (fctx->fpu)
     51            "fxrstor %[fctx]\n"
     52            : [fctx] "=m" (fctx->fpu)
    5353        );
    5454}
     
    6060         * it masks all FPU exceptions*/
    6161        asm volatile (
    62                 "fninit\n"
     62            "fninit\n"
    6363        );
    6464}
  • kernel/arch/amd64/src/interrupt.c

    r47b2d7e3 r1433ecda  
    6060 */
    6161
    62 void (* disable_irqs_function)(uint16_t irqmask) = NULL;
    63 void (* enable_irqs_function)(uint16_t irqmask) = NULL;
    64 void (* eoi_function)(void) = NULL;
     62void (*disable_irqs_function)(uint16_t irqmask) = NULL;
     63void (*enable_irqs_function)(uint16_t irqmask) = NULL;
     64void (*eoi_function)(void) = NULL;
    6565const char *irqs_info = NULL;
    6666
     
    231231            (iroutine_t) tlb_shootdown_ipi);
    232232        exc_register(VECTOR_SMP_CALL_IPI, "smp_call", true,
    233                 (iroutine_t) arch_smp_call_ipi_recv);
     233            (iroutine_t) arch_smp_call_ipi_recv);
    234234#endif
    235235}
  • kernel/arch/amd64/src/pm.c

    r47b2d7e3 r1433ecda  
    5555                .limit_0_15 = 0xffffU,
    5656                .limit_16_19 = 0xfU,
    57                 .access = AR_PRESENT | AR_CODE | DPL_KERNEL | AR_READABLE,
     57                .access = AR_PRESENT | AR_CODE | DPL_KERNEL | AR_READABLE,
    5858                .longmode = 1,
    5959                .granularity = 1
Note: See TracChangeset for help on using the changeset viewer.