]> Zhao Yanbai Git Server - minix.git/commitdiff
gas2ack support for rdmsr and wrmsr
authorTomas Hruby <tom@minix3.org>
Thu, 12 Nov 2009 16:19:01 +0000 (16:19 +0000)
committerTomas Hruby <tom@minix3.org>
Thu, 12 Nov 2009 16:19:01 +0000 (16:19 +0000)
commands/i386/gas2ack/asm86.h
commands/i386/gas2ack/emit_ack.c
commands/i386/gas2ack/parse_gnu.c

index aae77bdbb1a31eb05c78b03fa82017ecc11f274f..499413312d274a8d08645c69e978db9cf1bdf458 100644 (file)
@@ -152,6 +152,7 @@ typedef enum opcode {       /* 80486 opcodes, from the i486 reference manual.
        PUSHF,
        RCL,    RCR,    ROL,    ROR,
        RET,    RETF,                   /* RETF added */
+       RDMSR,
        SAHF,
        SAL,    SAR,    SHL,    SHR,
        SBB,
@@ -173,6 +174,7 @@ typedef enum opcode {       /* 80486 opcodes, from the i486 reference manual.
        VERR,   VERW,
        WAIT,
        WBINVD,
+       WRMSR,
        XADD,
        XCHG,
        XLAT,
index 5a956e9960bc90b740d7eeadfa09de1fb288108d..8b97d66c192d5db37a440aa6bfcedb087c18a97f 100644 (file)
@@ -249,6 +249,7 @@ static mnemonic_t mnemtab[] = {
        { RCR,          "rcr%"          },
        { RET,          "ret"           },
        { RETF,         "retf"          },
+       { RDMSR,        "rdmsr"         },
        { ROL,          "rol%"          },
        { ROR,          "ror%"          },
        { SAHF,         "sahf"          },
@@ -291,6 +292,7 @@ static mnemonic_t mnemtab[] = {
        { VERW,         "verw"          },
        { WAIT,         "wait"          },
        { WBINVD,       "wbinvd"        },
+       { WRMSR,        "wrmsr"         },
        { XADD,         "xadd"          },
        { XCHG,         "xchg%"         },
        { XLAT,         "xlat"          },
@@ -605,6 +607,14 @@ void ack_emit_instruction(asm86_t *a)
                                return;
                        }
                }
+               if (a->opcode == RDMSR) {
+                       ack_printf(".data1 0x0f, 0x32\n");
+                       return;
+               }
+               if (a->opcode == WRMSR) {
+                       ack_printf(".data1 0x0f, 0x30\n");
+                       return;
+               }
                /* we are translating from GNU */
                if (a->args && a->args->operator == ','
                                /* don't swap ljmp prefixed with segment */
index 56960b51d7a4afc2b14eac532bba2c7294f0c6ff..98a1f5f4330e04d73a3217fbb250e7fdf51e6ddb 100644 (file)
@@ -335,6 +335,7 @@ static mnemonic_t mnemtab[] = {                     /* This array is sorted. */
        { "rcrw",       RCR,            OWORD },
        { "ret",        RET,            JUMP },
        { "retf",       RETF,           JUMP },
+       { "rdmsr",      RDMSR,          WORD },
        { "rolb",       ROL,            BYTE },
        { "roll",       ROL,            WORD },
        { "rolw",       ROL,            OWORD },
@@ -407,6 +408,7 @@ static mnemonic_t mnemtab[] = {                     /* This array is sorted. */
        { "verw",       VERW,           WORD },
        { "wait",       WAIT,           WORD },
        { "wbinvd",     WBINVD,         WORD },
+       { "wrmsr",      WRMSR,          WORD },
        { "xadd",       XADD,           WORD },
        { "xchgb",      XCHG,           BYTE },
        { "xchgl",      XCHG,           WORD },