Add MSRGet()

This commit is contained in:
VoidNV 2021-01-28 19:10:11 -06:00
parent 3c6187254a
commit 79e7caaad4
5 changed files with 20 additions and 4 deletions

Binary file not shown.

View file

@ -1,9 +1,12 @@
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
$IV,1$----01/28/21 19:08:16----$IV,0$
* Added $LK,"MSRGet",A="MN:MSRGet"$().
$IV,1$----01/24/21 01:51:12----$IV,0$
* Removed DriveMap().
$IV,1$----12/23/20 18:27:18----$IV,0$
* Reformatting of files is now virtually complete.
* Reformatting of files is virtually complete now.
$IV,1$----01/11/21 23:39:21----$IV,0$
* Restored "Daemon" -> "Seth".

View file

@ -1,7 +1,7 @@
U0 PortNop()
{//Innoculous (reads IRQ Mask) which should take fixed time
//because it's an ISA-bus standard. It takes 1.0uS-2.0uS.
InU8(0x21);
InU8(PIC_1_DATA);
}
U0 IntCore0TimerHandler(CTask *)

View file

@ -549,7 +549,19 @@ _RET::
RET
/***********************************/
_SET_MSR::
_MSR_GET::
PUSH RBP
MOV RBP, RSP
MOV RCX, SF_ARG1[RBP]
RDMSR
SHL RDX, 32
MOV EDX, EAX
MOV RAX, RDX
POP RBP
RET1 8
/***********************************/
_MSR_SET::
PUSH RBP
MOV RBP, RSP
MOV RAX, SF_ARG2[RBP]

View file

@ -219,7 +219,8 @@ public _extern _LXCHG_I64 I64 LXchgI64(I64 *dst, I64 d); //Locked eXchange I64
public _extern _LXCHG_U16 U16 LXchgU16(U16 *dst, U16 d); //Locked eXchange U16s.
public _extern _LXCHG_U32 U32 LXchgU32(U32 *dst, U32 d); //Locked eXchange U32s.
public _extern _LXCHG_U8 U8 LXchgU8( U8 *dst, U8 d); //Locked eXchange U8s.
public _extern _SET_MSR U0 SetMSR(I64 model_specific_reg, I64 val); //Model Specific Reg See $LK,"MSRs",A="MN:IA32_EFER"$.
public _extern _MSR_GET I64 MSRGet(I64 model_specific_reg); //Model Specific Reg See $LK,"MSRs",A="MN:IA32_EFER"$.
public _extern _MSR_SET U0 MSRSet(I64 model_specific_reg, I64 val); //Model Specific Reg See $LK,"MSRs",A="MN:IA32_EFER"$.
public _extern _SYS_HLT U0 SysHlt(); //Loops doing HLT inst.
public _extern _XCHG_I64 I64 XchgI64(I64 *dst, I64 d); //eXchange I64s.
public _extern _XCHG_U16 U16 XchgU16(U16 *dst, U16 d); //eXchange U16s.