Changeset 3bacee1 in mainline for kernel/arch/ia32


Ignore:
Timestamp:
2018-04-12T16:27:17Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

Location:
kernel/arch/ia32
Files:
3 edited

Legend:

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

    r76d0981d r3bacee1  
    5252        while (true) {
    5353                asm volatile (
    54                         "hlt\n"
     54                    "hlt\n"
    5555                );
    5656        }
     
    6060{
    6161        asm volatile (
    62                 "hlt\n"
     62            "hlt\n"
    6363        );
    6464}
     
    117117        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    118118                asm volatile (
    119                         "outb %b[val], %w[port]\n"
    120                         :: [val] "a" (val), [port] "d" (port)
     119                    "outb %b[val], %w[port]\n"
     120                    :: [val] "a" (val), [port] "d" (port)
    121121                );
    122122        } else
     
    136136        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    137137                asm volatile (
    138                         "outw %w[val], %w[port]\n"
    139                         :: [val] "a" (val), [port] "d" (port)
     138                    "outw %w[val], %w[port]\n"
     139                    :: [val] "a" (val), [port] "d" (port)
    140140                );
    141141        } else
     
    155155        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    156156                asm volatile (
    157                         "outl %[val], %w[port]\n"
    158                         :: [val] "a" (val), [port] "d" (port)
     157                    "outl %[val], %w[port]\n"
     158                    :: [val] "a" (val), [port] "d" (port)
    159159                );
    160160        } else
     
    176176
    177177                asm volatile (
    178                         "inb %w[port], %b[val]\n"
    179                         : [val] "=a" (val)
    180                         : [port] "d" (port)
     178                    "inb %w[port], %b[val]\n"
     179                    : [val] "=a" (val)
     180                    : [port] "d" (port)
    181181                );
    182182
     
    200200
    201201                asm volatile (
    202                         "inw %w[port], %w[val]\n"
    203                         : [val] "=a" (val)
    204                         : [port] "d" (port)
     202                    "inw %w[port], %w[val]\n"
     203                    : [val] "=a" (val)
     204                    : [port] "d" (port)
    205205                );
    206206
     
    224224
    225225                asm volatile (
    226                         "inl %w[port], %[val]\n"
    227                         : [val] "=a" (val)
    228                         : [port] "d" (port)
     226                    "inl %w[port], %[val]\n"
     227                    : [val] "=a" (val)
     228                    : [port] "d" (port)
    229229                );
    230230
     
    239239
    240240        asm volatile (
    241                 "pushf\n"
    242                 "popl %[v]\n"
    243                 : [v] "=r" (eflags)
     241            "pushf\n"
     242            "popl %[v]\n"
     243            : [v] "=r" (eflags)
    244244        );
    245245
     
    250250{
    251251        asm volatile (
    252                 "pushl %[v]\n"
    253                 "popf\n"
    254                 :: [v] "r" (eflags)
     252            "pushl %[v]\n"
     253            "popf\n"
     254            :: [v] "r" (eflags)
    255255        );
    256256}
     
    326326{
    327327        asm volatile (
    328                 "wrmsr"
    329                 :: "c" (msr),
    330                    "a" ((uint32_t) (value)),
    331                    "d" ((uint32_t) (value >> 32))
     328            "wrmsr"
     329            :: "c" (msr),
     330              "a" ((uint32_t) (value)),
     331              "d" ((uint32_t) (value >> 32))
    332332        );
    333333}
     
    338338
    339339        asm volatile (
    340                 "rdmsr"
    341                 : "=a" (ax),
    342                   "=d" (dx)
    343                 : "c" (msr)
     340            "rdmsr"
     341            : "=a" (ax),
     342              "=d" (dx)
     343            : "c" (msr)
    344344        );
    345345
     
    362362
    363363        asm volatile (
    364                 "andl %%esp, %[v]\n"
    365                 : [v] "=r" (v)
    366                 : "0" (~(STACK_SIZE - 1))
     364            "andl %%esp, %[v]\n"
     365            : [v] "=r" (v)
     366            : "0" (~(STACK_SIZE - 1))
    367367        );
    368368
     
    378378{
    379379        asm volatile (
    380                 "invlpg %[addr]\n"
    381                 :: [addr] "m" (*(sysarg_t *) addr)
     380            "invlpg %[addr]\n"
     381            :: [addr] "m" (*(sysarg_t *) addr)
    382382        );
    383383}
     
    391391{
    392392        asm volatile (
    393                 "lgdtl %[gdtr_reg]\n"
    394                 :: [gdtr_reg] "m" (*gdtr_reg)
     393            "lgdtl %[gdtr_reg]\n"
     394            :: [gdtr_reg] "m" (*gdtr_reg)
    395395        );
    396396}
     
    404404{
    405405        asm volatile (
    406                 "sgdtl %[gdtr_reg]\n"
    407                 : [gdtr_reg] "=m" (*gdtr_reg)
     406            "sgdtl %[gdtr_reg]\n"
     407            : [gdtr_reg] "=m" (*gdtr_reg)
    408408        );
    409409}
     
    417417{
    418418        asm volatile (
    419                 "lidtl %[idtr_reg]\n"
    420                 :: [idtr_reg] "m" (*idtr_reg)
     419            "lidtl %[idtr_reg]\n"
     420            :: [idtr_reg] "m" (*idtr_reg)
    421421        );
    422422}
     
    430430{
    431431        asm volatile (
    432                 "ltr %[sel]"
    433                 :: [sel] "r" (sel)
     432            "ltr %[sel]"
     433            :: [sel] "r" (sel)
    434434        );
    435435}
     
    443443{
    444444        asm volatile (
    445                 "mov %[sel], %%gs"
    446                 :: [sel] "r" (sel)
     445            "mov %[sel], %%gs"
     446            :: [sel] "r" (sel)
    447447        );
    448448}
  • kernel/arch/ia32/src/cpu/cpu.c

    r76d0981d r3bacee1  
    101101        if (CPU->arch.fi.bits.sse) {
    102102                asm volatile (
    103                         "mov %%cr4, %[help]\n"
    104                         "or %[mask], %[help]\n"
    105                         "mov %[help], %%cr4\n"
    106                         : [help] "+r" (help)
    107                         : [mask] "i" (CR4_OSFXSR | CR4_OSXMMEXCPT)
     103                    "mov %%cr4, %[help]\n"
     104                    "or %[mask], %[help]\n"
     105                    "mov %[help], %%cr4\n"
     106                    : [help] "+r" (help)
     107                    : [mask] "i" (CR4_OSFXSR | CR4_OSXMMEXCPT)
    108108                );
    109109        }
     
    128128                 * Check for AMD processor.
    129129                 */
    130                 if ((info.cpuid_ebx == AMD_CPUID_EBX)
    131                     && (info.cpuid_ecx == AMD_CPUID_ECX)
    132                     && (info.cpuid_edx == AMD_CPUID_EDX))
     130                if ((info.cpuid_ebx == AMD_CPUID_EBX) &&
     131                    (info.cpuid_ecx == AMD_CPUID_ECX) &&
     132                    (info.cpuid_edx == AMD_CPUID_EDX))
    133133                        CPU->arch.vendor = VendorAMD;
    134134
     
    136136                 * Check for Intel processor.
    137137                 */
    138                 if ((info.cpuid_ebx == INTEL_CPUID_EBX)
    139                     && (info.cpuid_ecx == INTEL_CPUID_ECX)
    140                     && (info.cpuid_edx == INTEL_CPUID_EDX))
     138                if ((info.cpuid_ebx == INTEL_CPUID_EBX) &&
     139                    (info.cpuid_ecx == INTEL_CPUID_ECX) &&
     140                    (info.cpuid_edx == INTEL_CPUID_EDX))
    141141                        CPU->arch.vendor = VendorIntel;
    142142
     
    148148}
    149149
    150 void cpu_print_report(cpu_t* cpu)
     150void cpu_print_report(cpu_t *cpu)
    151151{
    152152        printf("cpu%u: (%s family=%u model=%u stepping=%u apicid=%u) %" PRIu16
    153                 " MHz\n", cpu->id, vendor_str[cpu->arch.vendor], cpu->arch.family,
    154                 cpu->arch.model, cpu->arch.stepping, cpu->arch.id, cpu->frequency_mhz);
     153            " MHz\n", cpu->id, vendor_str[cpu->arch.vendor], cpu->arch.family,
     154            cpu->arch.model, cpu->arch.stepping, cpu->arch.id, cpu->frequency_mhz);
    155155}
    156156
  • kernel/arch/ia32/src/ia32.c

    r76d0981d r3bacee1  
    200200        outdev_t **ns16550_out_ptr = NULL;
    201201#endif
    202         ns16550_instance_t *ns16550_instance
    203             = ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,
     202        ns16550_instance_t *ns16550_instance =
     203            ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,
    204204            ns16550_out_ptr);
    205205        if (ns16550_instance) {
Note: See TracChangeset for help on using the changeset viewer.