Changeset 3bacee1 in mainline for kernel/arch/amd64


Ignore:
Timestamp:
2018-04-12T16:27:17Z (7 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/amd64
Files:
2 edited

Legend:

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

    r76d0981d r3bacee1  
    5555
    5656        asm volatile (
    57                 "andq %%rsp, %[v]\n"
    58                 : [v] "=r" (v)
    59                 : "0" (~((uint64_t) STACK_SIZE - 1))
     57            "andq %%rsp, %[v]\n"
     58            : [v] "=r" (v)
     59            : "0" (~((uint64_t) STACK_SIZE - 1))
    6060        );
    6161
     
    6666{
    6767        asm volatile (
    68                 "hlt\n"
     68            "hlt\n"
    6969        );
    7070}
     
    7474        while (true) {
    7575                asm volatile (
    76                         "hlt\n"
     76                    "hlt\n"
    7777                );
    7878        }
     
    9393
    9494                asm volatile (
    95                         "inb %w[port], %b[val]\n"
    96                         : [val] "=a" (val)
    97                         : [port] "d" (port)
     95                    "inb %w[port], %b[val]\n"
     96                    : [val] "=a" (val)
     97                    : [port] "d" (port)
    9898                );
    9999
     
    117117
    118118                asm volatile (
    119                         "inw %w[port], %w[val]\n"
    120                         : [val] "=a" (val)
    121                         : [port] "d" (port)
     119                    "inw %w[port], %w[val]\n"
     120                    : [val] "=a" (val)
     121                    : [port] "d" (port)
    122122                );
    123123
     
    141141
    142142                asm volatile (
    143                         "inl %w[port], %[val]\n"
    144                         : [val] "=a" (val)
    145                         : [port] "d" (port)
     143                    "inl %w[port], %[val]\n"
     144                    : [val] "=a" (val)
     145                    : [port] "d" (port)
    146146                );
    147147
     
    163163        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    164164                asm volatile (
    165                         "outb %b[val], %w[port]\n"
    166                         :: [val] "a" (val), [port] "d" (port)
     165                    "outb %b[val], %w[port]\n"
     166                    :: [val] "a" (val), [port] "d" (port)
    167167                );
    168168        } else
     
    182182        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    183183                asm volatile (
    184                         "outw %w[val], %w[port]\n"
    185                         :: [val] "a" (val), [port] "d" (port)
     184                    "outw %w[val], %w[port]\n"
     185                    :: [val] "a" (val), [port] "d" (port)
    186186                );
    187187        } else
     
    201201        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    202202                asm volatile (
    203                         "outl %[val], %w[port]\n"
    204                         :: [val] "a" (val), [port] "d" (port)
     203                    "outl %[val], %w[port]\n"
     204                    :: [val] "a" (val), [port] "d" (port)
    205205                );
    206206        } else
     
    213213
    214214        asm volatile (
    215                 "pushfq\n"
    216                 "popq %[v]\n"
    217                 : [v] "=r" (rflags)
     215            "pushfq\n"
     216            "popq %[v]\n"
     217            : [v] "=r" (rflags)
    218218        );
    219219
     
    224224{
    225225        asm volatile (
    226                 "pushq %[v]\n"
    227                 "popfq\n"
    228                 :: [v] "r" (rflags)
     226            "pushq %[v]\n"
     227            "popfq\n"
     228            :: [v] "r" (rflags)
    229229        );
    230230}
     
    300300{
    301301        asm volatile (
    302                 "wrmsr\n"
    303                 :: "c" (msr),
    304                    "a" ((uint32_t) (value)),
    305                    "d" ((uint32_t) (value >> 32))
     302            "wrmsr\n"
     303            :: "c" (msr),
     304              "a" ((uint32_t) (value)),
     305              "d" ((uint32_t) (value >> 32))
    306306        );
    307307}
     
    312312
    313313        asm volatile (
    314                 "rdmsr\n"
    315                 : "=a" (ax), "=d" (dx)
    316                 : "c" (msr)
     314            "rdmsr\n"
     315            : "=a" (ax), "=d" (dx)
     316            : "c" (msr)
    317317        );
    318318
     
    328328{
    329329        asm volatile (
    330                 "invlpg %[addr]\n"
    331                 :: [addr] "m" (*((sysarg_t *) addr))
     330            "invlpg %[addr]\n"
     331            :: [addr] "m" (*((sysarg_t *) addr))
    332332        );
    333333}
     
    341341{
    342342        asm volatile (
    343                 "lgdtq %[gdtr_reg]\n"
    344                 :: [gdtr_reg] "m" (*gdtr_reg)
     343            "lgdtq %[gdtr_reg]\n"
     344            :: [gdtr_reg] "m" (*gdtr_reg)
    345345        );
    346346}
     
    354354{
    355355        asm volatile (
    356                 "sgdtq %[gdtr_reg]\n"
    357                 :: [gdtr_reg] "m" (*gdtr_reg)
     356            "sgdtq %[gdtr_reg]\n"
     357            :: [gdtr_reg] "m" (*gdtr_reg)
    358358        );
    359359}
     
    367367{
    368368        asm volatile (
    369                 "lidtq %[idtr_reg]\n"
    370                 :: [idtr_reg] "m" (*idtr_reg));
     369            "lidtq %[idtr_reg]\n"
     370            :: [idtr_reg] "m" (*idtr_reg));
    371371}
    372372
     
    379379{
    380380        asm volatile (
    381                 "ltr %[sel]"
    382                 :: [sel] "r" (sel)
     381            "ltr %[sel]"
     382            :: [sel] "r" (sel)
    383383        );
    384384}
  • kernel/arch/amd64/src/amd64.c

    r76d0981d r3bacee1  
    215215        outdev_t **ns16550_out_ptr = NULL;
    216216#endif
    217         ns16550_instance_t *ns16550_instance
    218             = ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,
     217        ns16550_instance_t *ns16550_instance =
     218            ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,
    219219            ns16550_out_ptr);
    220220        if (ns16550_instance) {
Note: See TracChangeset for help on using the changeset viewer.