Skip to content

Commit

Permalink
Add missing flagc from RFLAGS
Browse files Browse the repository at this point in the history
FLAGC is the lower bit of the I/O Permission Level field.
  • Loading branch information
hainest committed Nov 21, 2023
1 parent fdd2d76 commit 53625db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/h/registers/x86_64_regs.h
Expand Up @@ -129,6 +129,7 @@ namespace Dyninst { namespace x86_64 {
const signed int IF = x86::IF; // Interrupt Enable Flag
const signed int DF = x86::DF; // Direction Flag
const signed int OF = x86::OF; // Overflow Flag
const signed int FLAGC = x86::FLAGC; // I/O Privilege Level (bits 12 and 13)
const signed int NT = x86::NT; // Nested Task
const signed int RF = x86::RF; // Resume Flag

Expand Down Expand Up @@ -216,6 +217,7 @@ namespace Dyninst { namespace x86_64 {
DEF_REGISTER( if_, IF | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( df, DF | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( of, OF | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( flagc, FLAGC | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( nt_, NT | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( rf, RF | BIT | FLAG | Arch_x86_64, "x86_64");
DEF_REGISTER( ds, BASEDS | FULL | SEG | Arch_x86_64, "x86_64");
Expand Down
1 change: 1 addition & 0 deletions common/src/registers/MachRegister.C
Expand Up @@ -809,6 +809,7 @@ namespace Dyninst {
case x86_64::IF: n = x86_flag_if; break;
case x86_64::DF: n = x86_flag_df; break;
case x86_64::OF: n = x86_flag_of; break;
case x86_64::FLAGC: n = x86_flag_iopl0; break;
default:
c = -1;
return;
Expand Down
2 changes: 2 additions & 0 deletions dataflowAPI/src/SymEvalPolicy.C
Expand Up @@ -474,6 +474,8 @@ Absloc SymEvalPolicy_64::convert(X86Flag f)
return Absloc(x86_64::df);
case x86_flag_of:
return Absloc(x86_64::of);
case x86_flag_iopl0:
return Absloc(x86_64::FLAGC);
case x86_flag_nt:
return Absloc(x86_64::nt_);
default:
Expand Down

0 comments on commit 53625db

Please sign in to comment.