mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Change the FS read/write functions to macros and use constant addressing instead of register.
svn path=/trunk/; revision=19438
This commit is contained in:
parent
ee6bd345aa
commit
be3e833bc3
2 changed files with 7 additions and 15 deletions
|
@ -60,21 +60,11 @@ HalQueryDisplayOwnership();
|
|||
#define Ki386DisableInterrupts() __asm__ __volatile__("cli\n\t")
|
||||
#define Ki386EnableInterrupts() __asm__ __volatile__("sti\n\t")
|
||||
#define Ki386HaltProcessor() __asm__ __volatile__("hlt\n\t")
|
||||
#define Ki386RdTSC(x) __asm__ __volatile__("rdtsc\n\t" : "=A" (x.u.LowPart), "=d" (x.u.HighPart));
|
||||
#define Ki386RdTSC(x) __asm__ __volatile__("rdtsc\n\t" : "=A" (x.u.LowPart), "=d" (x.u.HighPart))
|
||||
#define Ki386Rdmsr(msr,val1,val2) __asm__ __volatile__("rdmsr" : "=a" (val1), "=d" (val2) : "c" (msr))
|
||||
#define Ki386Wrmsr(msr,val1,val2) __asm__ __volatile__("wrmsr" : /* no outputs */ : "c" (msr), "a" (val1), "d" (val2))
|
||||
|
||||
static inline BYTE Ki386ReadFsByte(ULONG offset)
|
||||
{
|
||||
BYTE b;
|
||||
__asm__ __volatile__("movb %%fs:(%1),%0":"=q" (b):"r" (offset));
|
||||
return b;
|
||||
}
|
||||
|
||||
static inline VOID Ki386WriteFsByte(ULONG offset, BYTE value)
|
||||
{
|
||||
__asm__ __volatile__("movb %0,%%fs:(%1)"::"q" (value), "r" (offset));
|
||||
}
|
||||
#define Ki386ReadFsByte(offset,x) __asm__ __volatile__("movb %%fs:%c1,%0" : "=q" (x) : "i" (offset))
|
||||
#define Ki386WriteFsByte(offset,x) __asm__ __volatile__("movb %0,%%fs:%c1" : : "q" ((UCHAR)x), "i" (offset))
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
#define Ki386SaveFlags(x) __asm pushfd __asm pop x;
|
||||
|
|
|
@ -33,7 +33,7 @@ KIRQL STDCALL KeGetCurrentIrql (VOID)
|
|||
Ki386SaveFlags(Flags);
|
||||
Ki386DisableInterrupts();
|
||||
|
||||
irql = Ki386ReadFsByte(FIELD_OFFSET(KPCR, Irql));
|
||||
Ki386ReadFsByte(FIELD_OFFSET(KPCR, Irql), irql);
|
||||
if (irql > HIGH_LEVEL)
|
||||
{
|
||||
DPRINT1 ("CurrentIrql %x\n", irql);
|
||||
|
@ -72,6 +72,7 @@ VOID
|
|||
HalpLowerIrql(KIRQL NewIrql, BOOL FromHalEndSystemInterrupt)
|
||||
{
|
||||
ULONG Flags;
|
||||
UCHAR DpcRequested;
|
||||
if (NewIrql >= DISPATCH_LEVEL)
|
||||
{
|
||||
KeSetCurrentIrql (NewIrql);
|
||||
|
@ -83,7 +84,8 @@ HalpLowerIrql(KIRQL NewIrql, BOOL FromHalEndSystemInterrupt)
|
|||
{
|
||||
KeSetCurrentIrql (DISPATCH_LEVEL);
|
||||
APICWrite(APIC_TPR, IRQL2TPR (DISPATCH_LEVEL) & APIC_TPR_PRI);
|
||||
if (FromHalEndSystemInterrupt || Ki386ReadFsByte(FIELD_OFFSET(KIPCR, HalReserved[HAL_DPC_REQUEST])))
|
||||
Ki386ReadFsByte(FIELD_OFFSET(KIPCR, HalReserved[HAL_DPC_REQUEST]), DpcRequested);
|
||||
if (FromHalEndSystemInterrupt || DpcRequested)
|
||||
{
|
||||
Ki386WriteFsByte(FIELD_OFFSET(KIPCR, HalReserved[HAL_DPC_REQUEST]), 0);
|
||||
Ki386EnableInterrupts();
|
||||
|
|
Loading…
Reference in a new issue