Changeset 1433ecda in mainline for kernel/arch/ia32/include


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/ia32/include/arch
Files:
8 edited

Legend:

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

    r47b2d7e3 r1433ecda  
    4646#ifdef CONFIG_SMP
    4747        asm volatile (
    48                 "lock incl %[count]\n"
    49                 : [count] "+m" (val->count)
    50         );
    51 #else
    52         asm volatile (
    53                 "incl %[count]\n"
    54                 : [count] "+m" (val->count)
     48            "lock incl %[count]\n"
     49            : [count] "+m" (val->count)
     50        );
     51#else
     52        asm volatile (
     53            "incl %[count]\n"
     54            : [count] "+m" (val->count)
    5555        );
    5656#endif /* CONFIG_SMP */
     
    6161#ifdef CONFIG_SMP
    6262        asm volatile (
    63                 "lock decl %[count]\n"
    64                 : [count] "+m" (val->count)
    65         );
    66 #else
    67         asm volatile (
    68                 "decl %[count]\n"
    69                 : [count] "+m" (val->count)
     63            "lock decl %[count]\n"
     64            : [count] "+m" (val->count)
     65        );
     66#else
     67        asm volatile (
     68            "decl %[count]\n"
     69            : [count] "+m" (val->count)
    7070        );
    7171#endif /* CONFIG_SMP */
     
    7777
    7878        asm volatile (
    79                 "lock xaddl %[r], %[count]\n"
    80                 : [count] "+m" (val->count),
    81                   [r] "+r" (r)
     79            "lock xaddl %[r], %[count]\n"
     80            : [count] "+m" (val->count),
     81              [r] "+r" (r)
    8282        );
    8383
     
    9090
    9191        asm volatile (
    92                 "lock xaddl %[r], %[count]\n"
    93                 : [count] "+m" (val->count),
    94                   [r] "+r" (r)
     92            "lock xaddl %[r], %[count]\n"
     93            : [count] "+m" (val->count),
     94              [r] "+r" (r)
    9595        );
    9696
     
    106106
    107107        asm volatile (
    108                 "xchgl %[v], %[count]\n"
    109                 : [v] "+r" (v),
    110                   [count] "+m" (val->count)
     108            "xchgl %[v], %[count]\n"
     109            : [v] "+r" (v),
     110              [count] "+m" (val->count)
    111111        );
    112112
     
    122122        preemption_disable();
    123123        asm volatile (
    124                 "0:\n"
     124            "0:\n"
    125125#ifndef PROCESSOR_i486
    126                 "pause\n"        /* Pentium 4's HT love this instruction */
    127 #endif
    128                 "mov %[count], %[tmp]\n"
    129                 "testl %[tmp], %[tmp]\n"
    130                 "jnz 0b\n"       /* lightweight looping on locked spinlock */
    131 
    132                 "incl %[tmp]\n"  /* now use the atomic operation */
    133                 "xchgl %[count], %[tmp]\n"
    134                 "testl %[tmp], %[tmp]\n"
    135                 "jnz 0b\n"
    136                 : [count] "+m" (val->count),
    137                   [tmp] "=&r" (tmp)
     126            "pause\n"        /* Pentium 4's HT love this instruction */
     127#endif
     128            "mov %[count], %[tmp]\n"
     129            "testl %[tmp], %[tmp]\n"
     130            "jnz 0b\n"       /* lightweight looping on locked spinlock */
     131
     132            "incl %[tmp]\n"  /* now use the atomic operation */
     133            "xchgl %[count], %[tmp]\n"
     134            "testl %[tmp], %[tmp]\n"
     135            "jnz 0b\n"
     136            : [count] "+m" (val->count),
     137              [tmp] "=&r" (tmp)
    138138        );
    139139
  • kernel/arch/ia32/include/arch/barrier.h

    r47b2d7e3 r1433ecda  
    5656#ifndef __PIC__
    5757        asm volatile (
    58                 "xorl %%eax, %%eax\n"
    59                 "cpuid\n"
    60                 ::: "eax", "ebx", "ecx", "edx", "memory"
     58            "xorl %%eax, %%eax\n"
     59            "cpuid\n"
     60            ::: "eax", "ebx", "ecx", "edx", "memory"
    6161        );
    6262#else
    6363        /* Must not clobber PIC register ebx */
    6464        asm volatile (
    65                 "movl %%ebx, %%esi\n"
    66                 "xorl %%eax, %%eax\n"
    67                 "cpuid\n"
    68                 "movl %%esi, %%ebx\n"
    69                 ::: "eax", "ecx", "edx", "esi", "memory"
     65            "movl %%ebx, %%esi\n"
     66            "xorl %%eax, %%eax\n"
     67            "cpuid\n"
     68            "movl %%esi, %%ebx\n"
     69            ::: "eax", "ecx", "edx", "esi", "memory"
    7070        );
    7171#endif
     
    7373
    7474#if defined(CONFIG_FENCES_P4)
    75         #define memory_barrier()  asm volatile ("mfence\n" ::: "memory")
    76         #define read_barrier()    asm volatile ("lfence\n" ::: "memory")
    77         #ifdef CONFIG_WEAK_MEMORY
    78                 #define write_barrier()  asm volatile ("sfence\n" ::: "memory")
    79         #else
    80                 #define write_barrier()  asm volatile ("" ::: "memory");
    81         #endif
     75#define memory_barrier()  asm volatile ("mfence\n" ::: "memory")
     76#define read_barrier()    asm volatile ("lfence\n" ::: "memory")
     77#ifdef CONFIG_WEAK_MEMORY
     78#define write_barrier()  asm volatile ("sfence\n" ::: "memory")
     79#else
     80#define write_barrier()  asm volatile ("" ::: "memory");
     81#endif
    8282#elif defined(CONFIG_FENCES_P3)
    83         #define memory_barrier()  cpuid_serialization()
    84         #define read_barrier()    cpuid_serialization()
    85         #ifdef CONFIG_WEAK_MEMORY
    86                 #define write_barrier()  asm volatile ("sfence\n" ::: "memory")
    87         #else
    88                 #define write_barrier()  asm volatile ("" ::: "memory");
    89         #endif
     83#define memory_barrier()  cpuid_serialization()
     84#define read_barrier()    cpuid_serialization()
     85#ifdef CONFIG_WEAK_MEMORY
     86#define write_barrier()  asm volatile ("sfence\n" ::: "memory")
    9087#else
    91         #define memory_barrier()  cpuid_serialization()
    92         #define read_barrier()    cpuid_serialization()
    93         #ifdef CONFIG_WEAK_MEMORY
    94                 #define write_barrier()  cpuid_serialization()
    95         #else
    96                 #define write_barrier()  asm volatile ("" ::: "memory");
    97         #endif
     88#define write_barrier()  asm volatile ("" ::: "memory");
     89#endif
     90#else
     91#define memory_barrier()  cpuid_serialization()
     92#define read_barrier()    cpuid_serialization()
     93#ifdef CONFIG_WEAK_MEMORY
     94#define write_barrier()  cpuid_serialization()
     95#else
     96#define write_barrier()  asm volatile ("" ::: "memory");
     97#endif
    9898#endif
    9999
  • kernel/arch/ia32/include/arch/cpuid.h

    r47b2d7e3 r1433ecda  
    8585
    8686        asm volatile (
    87                 "pushf\n"                      /* read flags */
    88                 "popl %[ret]\n"
    89                 "movl %[ret], %[val]\n"
     87            "pushf\n"                      /* read flags */
     88            "popl %[ret]\n"
     89            "movl %[ret], %[val]\n"
    9090
    91                 "xorl %[eflags_id], %[val]\n"  /* swap the ID bit */
     91            "xorl %[eflags_id], %[val]\n"  /* swap the ID bit */
    9292
    93                 "pushl %[val]\n"               /* propagate the change into flags */
    94                 "popf\n"
    95                 "pushf\n"
    96                 "popl %[val]\n"
     93            "pushl %[val]\n"               /* propagate the change into flags */
     94            "popf\n"
     95            "pushf\n"
     96            "popl %[val]\n"
    9797
    98                 "andl %[eflags_id], %[ret]\n"  /* interrested only in ID bit */
    99                 "andl %[eflags_id], %[val]\n"
    100                 "xorl %[val], %[ret]\n"
    101                 : [ret] "=r" (ret), [val] "=r" (val)
    102                 : [eflags_id] "i" (EFLAGS_ID)
     98            "andl %[eflags_id], %[ret]\n"  /* interrested only in ID bit */
     99            "andl %[eflags_id], %[val]\n"
     100            "xorl %[val], %[ret]\n"
     101            : [ret] "=r" (ret), [val] "=r" (val)
     102            : [eflags_id] "i" (EFLAGS_ID)
    103103        );
    104104
     
    109109{
    110110        asm volatile (
    111                 "cpuid\n"
    112                 : "=a" (info->cpuid_eax), "=b" (info->cpuid_ebx),
    113                   "=c" (info->cpuid_ecx), "=d" (info->cpuid_edx)
    114                 : "a" (cmd)
     111            "cpuid\n"
     112            : "=a" (info->cpuid_eax), "=b" (info->cpuid_ebx),
     113              "=c" (info->cpuid_ecx), "=d" (info->cpuid_edx)
     114            : "a" (cmd)
    115115        );
    116116}
  • kernel/arch/ia32/include/arch/cycle.h

    r47b2d7e3 r1433ecda  
    4545        uint64_t v;
    4646
    47         asm volatile(
    48                 "rdtsc\n"
    49                 : "=A" (v)
     47        asm volatile (
     48            "rdtsc\n"
     49            : "=A" (v)
    5050        );
    5151
  • kernel/arch/ia32/include/arch/mm/page.h

    r47b2d7e3 r1433ecda  
    178178        unsigned avl : 2;
    179179        unsigned frame_address : 20;
    180 } __attribute__ ((packed)) pte_t;
     180} __attribute__((packed)) pte_t;
    181181
    182182NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
  • kernel/arch/ia32/include/arch/pm.h

    r47b2d7e3 r1433ecda  
    8989        uint16_t limit;
    9090        uint32_t base;
    91 } __attribute__ ((packed)) ptr_16_32_t;
     91} __attribute__((packed)) ptr_16_32_t;
    9292
    9393typedef struct {
    94         unsigned limit_0_15: 16;
    95         unsigned base_0_15: 16;
    96         unsigned base_16_23: 8;
    97         unsigned access: 8;
    98         unsigned limit_16_19: 4;
    99         unsigned available: 1;
    100         unsigned unused: 1;
    101         unsigned special: 1;
     94        unsigned limit_0_15 : 16;
     95        unsigned base_0_15 : 16;
     96        unsigned base_16_23 : 8;
     97        unsigned access : 8;
     98        unsigned limit_16_19 : 4;
     99        unsigned available : 1;
     100        unsigned unused : 1;
     101        unsigned special : 1;
    102102        unsigned granularity : 1;
    103         unsigned base_24_31: 8;
    104 } __attribute__ ((packed)) descriptor_t;
     103        unsigned base_24_31 : 8;
     104} __attribute__((packed)) descriptor_t;
    105105
    106106typedef struct {
    107         unsigned offset_0_15: 16;
    108         unsigned selector: 16;
    109         unsigned unused: 8;
    110         unsigned access: 8;
    111         unsigned offset_16_31: 16;
    112 } __attribute__ ((packed)) idescriptor_t;
     107        unsigned offset_0_15 : 16;
     108        unsigned selector : 16;
     109        unsigned unused : 8;
     110        unsigned access : 8;
     111        unsigned offset_16_31 : 16;
     112} __attribute__((packed)) idescriptor_t;
    113113
    114114typedef struct {
     
    152152        uint16_t iomap_base;
    153153        uint8_t iomap[TSS_IOMAP_SIZE];
    154 } __attribute__ ((packed)) tss_t;
     154} __attribute__((packed)) tss_t;
    155155
    156156extern ptr_16_32_t gdtr;
  • kernel/arch/ia32/include/arch/smp/apic.h

    r47b2d7e3 r1433ecda  
    128128                        unsigned int shorthand : 2;     /**< Destination Shorthand. */
    129129                        unsigned int : 12;              /**< Reserved. */
    130                 } __attribute__ ((packed));
     130                } __attribute__((packed));
    131131        };
    132132        union {
     
    135135                        unsigned int : 24;  /**< Reserved. */
    136136                        uint8_t dest;       /**< Destination field. */
    137                 } __attribute__ ((packed));
     137                } __attribute__((packed));
    138138        };
    139 } __attribute__ ((packed)) icr_t;
     139} __attribute__((packed)) icr_t;
    140140
    141141/* End Of Interrupt. */
     
    158158                unsigned int illegal_register_address : 1;
    159159                unsigned int : 24;
    160         } __attribute__ ((packed));
     160        } __attribute__((packed));
    161161} esr_t;
    162162
     
    169169                unsigned int pri_sc : 4;  /**< Task Priority Sub-Class. */
    170170                unsigned int pri : 4;     /**< Task Priority. */
    171         } __attribute__ ((packed));
     171        } __attribute__((packed));
    172172} tpr_t;
    173173
     
    182182                unsigned int focus_checking : 1;  /**< Focus Processor Checking. */
    183183                unsigned int : 22;                /**< Reserved. */
    184         } __attribute__ ((packed));
     184        } __attribute__((packed));
    185185} svr_t;
    186186
     
    193193                unsigned int div_value : 4;  /**< Divide Value, bit 2 is always 0. */
    194194                unsigned int : 28;           /**< Reserved. */
    195         } __attribute__ ((packed));
     195        } __attribute__((packed));
    196196} tdcr_t;
    197197
     
    215215                unsigned int mode : 1;    /**< Timer Mode. */
    216216                unsigned int : 14;        /**< Reserved. */
    217         } __attribute__ ((packed));
     217        } __attribute__((packed));
    218218} lvt_tm_t;
    219219
     
    234234                unsigned int masked : 1;        /**< Interrupt Mask. */
    235235                unsigned int : 15;              /**< Reserved. */
    236         } __attribute__ ((packed));
     236        } __attribute__((packed));
    237237} lvt_lint_t;
    238238
     
    249249                unsigned int masked : 1;  /**< Interrupt Mask. */
    250250                unsigned int : 15;        /**< Reserved. */
    251         } __attribute__ ((packed));
     251        } __attribute__((packed));
    252252} lvt_error_t;
    253253
     
    260260                unsigned int : 24;  /**< Reserved. */
    261261                uint8_t apic_id;    /**< Local APIC ID. */
    262         } __attribute__ ((packed));
     262        } __attribute__((packed));
    263263} l_apic_id_t;
    264264
     
    279279                unsigned int : 24;  /**< Reserved. */
    280280                uint8_t id;         /**< Logical APIC ID. */
    281         } __attribute__ ((packed));
     281        } __attribute__((packed));
    282282} ldr_t;
    283283
     
    290290                unsigned int : 28;       /**< Reserved, all ones. */
    291291                unsigned int model : 4;  /**< Model. */
    292         } __attribute__ ((packed));
     292        } __attribute__((packed));
    293293} dfr_t;
    294294
     
    308308                uint8_t reg_addr;   /**< APIC Register Address. */
    309309                unsigned int : 24;  /**< Reserved. */
    310         } __attribute__ ((packed));
     310        } __attribute__((packed));
    311311} io_regsel_t;
    312312
     
    325325                        unsigned int masked : 1;        /**< Interrupt Mask. */
    326326                        unsigned int : 15;              /**< Reserved. */
    327                 } __attribute__ ((packed));
     327                } __attribute__((packed));
    328328        };
    329329        union {
     
    332332                        unsigned int : 24;  /**< Reserved. */
    333333                        uint8_t dest : 8;   /**< Destination Field. */
    334                 } __attribute__ ((packed));
     334                } __attribute__((packed));
    335335        };
    336336
    337 } __attribute__ ((packed)) io_redirection_reg_t;
     337} __attribute__((packed)) io_redirection_reg_t;
    338338
    339339
     
    345345                unsigned int apic_id : 4;  /**< IO APIC ID. */
    346346                unsigned int : 4;          /**< Reserved. */
    347         } __attribute__ ((packed));
     347        } __attribute__((packed));
    348348} io_apic_id_t;
    349349
  • kernel/arch/ia32/include/arch/smp/mps.h

    r47b2d7e3 r1433ecda  
    5555        uint8_t mpfib4;
    5656        uint8_t mpfib5;
    57 } __attribute__ ((packed));
     57} __attribute__((packed));
    5858
    5959struct mps_ct {
     
    7272        uint8_t reserved;
    7373        uint8_t base_table[0];
    74 } __attribute__ ((packed));
     74} __attribute__((packed));
    7575
    7676struct __processor_entry {
     
    8282        uint32_t feature_flags;
    8383        uint32_t reserved[2];
    84 } __attribute__ ((packed));
     84} __attribute__((packed));
    8585
    8686struct __bus_entry {
     
    8888        uint8_t bus_id;
    8989        uint8_t bus_type[6];
    90 } __attribute__ ((packed));
     90} __attribute__((packed));
    9191
    9292struct __io_apic_entry {
     
    9696        uint8_t io_apic_flags;
    9797        uint32_t io_apic;
    98 } __attribute__ ((packed));
     98} __attribute__((packed));
    9999
    100100struct __io_intr_entry {
     
    107107        uint8_t dst_io_apic_id;
    108108        uint8_t dst_io_apic_pin;
    109 } __attribute__ ((packed));
     109} __attribute__((packed));
    110110
    111111struct __l_intr_entry {
     
    118118        uint8_t dst_l_apic_id;
    119119        uint8_t dst_l_apic_pin;
    120 } __attribute__ ((packed));
     120} __attribute__((packed));
    121121
    122122extern struct smp_config_operations mps_config_operations;
Note: See TracChangeset for help on using the changeset viewer.