Fix loading CS segment for i686 architecture
Builds / ExectOS (i686) (push) Successful in 48s Details
Builds / ExectOS (amd64) (push) Successful in 50s Details

This commit is contained in:
Rafal Kupiec 2024-04-17 16:46:03 +02:00
parent 9d4751abee
commit b31aa82872
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 14 additions and 2 deletions

View File

@ -216,31 +216,43 @@ ArLoadSegment(IN USHORT Segment,
switch(Segment)
{
case SEGMENT_CS:
asm volatile("movl %0, %%cs"
/* Load CS Segment */
asm volatile("mov %0, %%eax\n"
"push %%eax\n"
"lea label, %%eax\n"
"push %%eax\n"
"lret\n"
"label:"
:
: "r" (Source));
: "ri" (Source)
: "eax");
break;
case SEGMENT_DS:
/* Load DS Segment */
asm volatile("movl %0, %%ds"
:
: "r" (Source));
break;
case SEGMENT_ES:
/* Load ES Segment */
asm volatile("movl %0, %%es"
:
: "r" (Source));
break;
case SEGMENT_FS:
/* Load FS Segment */
asm volatile("movl %0, %%fs"
:
: "r" (Source));
break;
case SEGMENT_GS:
/* Load GS Segment */
asm volatile("movl %0, %%gs"
:
: "r" (Source));
break;
case SEGMENT_SS:
/* Load SS Segment */
asm volatile("movl %0, %%ss"
:
: "r" (Source));