From 7b0c74ffb085656d67554102857224223ee03f88 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 9 Jun 2017 15:42:36 +0200 Subject: i386: Support thread-local storage (TLS) Update #2468. --- cpukit/score/cpu/i386/cpu_asm.S | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpukit/score/cpu/i386/cpu_asm.S') diff --git a/cpukit/score/cpu/i386/cpu_asm.S b/cpukit/score/cpu/i386/cpu_asm.S index 45079a65b8..6b609ab4ce 100644 --- a/cpukit/score/cpu/i386/cpu_asm.S +++ b/cpukit/score/cpu/i386/cpu_asm.S @@ -32,6 +32,8 @@ .set REG_EBX, I386_CONTEXT_CONTROL_EBX_OFFSET .set REG_ESI, I386_CONTEXT_CONTROL_ESI_OFFSET .set REG_EDI, I386_CONTEXT_CONTROL_EDI_OFFSET +.set REG_GS_0, I386_CONTEXT_CONTROL_GS_0_OFFSET +.set REG_GS_1, I386_CONTEXT_CONTROL_GS_1_OFFSET BEGIN_CODE @@ -83,6 +85,12 @@ restore: movl REG_EBX(eax),ebx /* restore ebx */ movl REG_ESI(eax),esi /* restore source register */ movl REG_EDI(eax),edi /* restore destination register */ + movl REG_GS_0(eax), ecx /* restore gs segment */ + movl REG_GS_1(eax), edx + movl ecx, _Global_descriptor_table + 24 + movl edx, _Global_descriptor_table + 28 + movl $24, ecx + mov ecx, gs ret /* -- cgit v1.2.3