mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Queried some values from pcr at DISPATCH_LEVEL to prevent from changing the processor after a thread switch.
- Changed from bx to dx within inline assembler, because the ebx register must be saved. svn path=/trunk/; revision=11502
This commit is contained in:
parent
0ca2950639
commit
914140ad22
1 changed files with 7 additions and 5 deletions
|
@ -134,7 +134,7 @@ KiInitializeGdt(PKPCR Pcr)
|
|||
"movl %1, %%fs\n\t"
|
||||
"movl %0, %%gs\n\t"
|
||||
: /* no output */
|
||||
: "a" (KERNEL_DS), "b" (PCR_SELECTOR));
|
||||
: "a" (KERNEL_DS), "d" (PCR_SELECTOR));
|
||||
__asm__ ("pushl %0\n\t"
|
||||
"pushl $.l4\n\t"
|
||||
"lret\n\t"
|
||||
|
@ -146,10 +146,10 @@ KiInitializeGdt(PKPCR Pcr)
|
|||
{
|
||||
lgdt Descriptor;
|
||||
mov ax, KERNEL_DS;
|
||||
mov bx, PCR_SELECTOR;
|
||||
mov dx, PCR_SELECTOR;
|
||||
mov ds, ax;
|
||||
mov es, ax;
|
||||
mov fs, bx;
|
||||
mov fs, dx;
|
||||
mov gs, ax;
|
||||
push KERNEL_CS;
|
||||
push offset l4 ;
|
||||
|
@ -207,13 +207,14 @@ KeSetBaseGdtSelector(ULONG Entry,
|
|||
PVOID Base)
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
PUSHORT Gdt = KeGetCurrentKPCR()->GDT;
|
||||
PUSHORT Gdt;
|
||||
|
||||
DPRINT("KeSetBaseGdtSelector(Entry %x, Base %x)\n",
|
||||
Entry, Base);
|
||||
|
||||
KeAcquireSpinLock(&GdtLock, &oldIrql);
|
||||
|
||||
Gdt = KeGetCurrentKPCR()->GDT;
|
||||
Entry = (Entry & (~0x3)) / 2;
|
||||
|
||||
Gdt[Entry + 1] = (USHORT)(((ULONG)Base) & 0xffff);
|
||||
|
@ -241,13 +242,14 @@ KeSetGdtSelector(ULONG Entry,
|
|||
ULONG Value2)
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
PULONG Gdt = (PULONG) KeGetCurrentKPCR()->GDT;
|
||||
PULONG Gdt;
|
||||
|
||||
DPRINT("KeSetGdtSelector(Entry %x, Value1 %x, Value2 %x)\n",
|
||||
Entry, Value1, Value2);
|
||||
|
||||
KeAcquireSpinLock(&GdtLock, &oldIrql);
|
||||
|
||||
Gdt = (PULONG) KeGetCurrentKPCR()->GDT;;
|
||||
Entry = (Entry & (~0x3)) / 4;
|
||||
|
||||
Gdt[Entry] = Value1;
|
||||
|
|
Loading…
Reference in a new issue