mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:04:57 +00:00
Kernel+Userland: Remove uses of the __i386__ compiler macro
This commit is contained in:
parent
36980d2a66
commit
7b9ea3efde
5 changed files with 6 additions and 37 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
# include <Kernel/Arch/x86_64/mcontext.h>
|
# include <Kernel/Arch/x86_64/mcontext.h>
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
# include <Kernel/Arch/aarch64/mcontext.h>
|
# include <Kernel/Arch/aarch64/mcontext.h>
|
||||||
|
|
|
@ -13,18 +13,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct __attribute__((packed)) __mcontext {
|
struct __attribute__((packed)) __mcontext {
|
||||||
#ifdef __i386__
|
|
||||||
uint32_t eax;
|
|
||||||
uint32_t ecx;
|
|
||||||
uint32_t edx;
|
|
||||||
uint32_t ebx;
|
|
||||||
uint32_t esp;
|
|
||||||
uint32_t ebp;
|
|
||||||
uint32_t esi;
|
|
||||||
uint32_t edi;
|
|
||||||
uint32_t eip;
|
|
||||||
uint32_t eflags;
|
|
||||||
#else
|
|
||||||
uint64_t rax;
|
uint64_t rax;
|
||||||
uint64_t rcx;
|
uint64_t rcx;
|
||||||
uint64_t rdx;
|
uint64_t rdx;
|
||||||
|
@ -43,7 +31,6 @@ struct __attribute__((packed)) __mcontext {
|
||||||
uint64_t r14;
|
uint64_t r14;
|
||||||
uint64_t r15;
|
uint64_t r15;
|
||||||
uint64_t rflags;
|
uint64_t rflags;
|
||||||
#endif
|
|
||||||
uint32_t cs;
|
uint32_t cs;
|
||||||
uint32_t ss;
|
uint32_t ss;
|
||||||
uint32_t ds;
|
uint32_t ds;
|
||||||
|
|
|
@ -39,11 +39,7 @@
|
||||||
# include <AK/Types.h>
|
# include <AK/Types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __i386__
|
#define ElfW(type) Elf64_##type
|
||||||
# define ElfW(type) Elf32_##type
|
|
||||||
#else
|
|
||||||
# define ElfW(type) Elf64_##type
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef uint8_t Elf_Byte;
|
typedef uint8_t Elf_Byte;
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,8 @@
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
#ifdef __i386__
|
#define __PRI64_PREFIX "l"
|
||||||
# define __PRI64_PREFIX "ll"
|
#define __PRIPTR_PREFIX "l"
|
||||||
# define __PRIPTR_PREFIX
|
|
||||||
#else
|
|
||||||
# define __PRI64_PREFIX "l"
|
|
||||||
# define __PRIPTR_PREFIX "l"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PRId8 "d"
|
#define PRId8 "d"
|
||||||
#define PRId16 "d"
|
#define PRId16 "d"
|
||||||
|
|
|
@ -19,14 +19,7 @@ __BEGIN_DECLS
|
||||||
//
|
//
|
||||||
|
|
||||||
struct __jmp_buf {
|
struct __jmp_buf {
|
||||||
#ifdef __i386__
|
#if defined(__x86_64__)
|
||||||
uint32_t ebx;
|
|
||||||
uint32_t esi;
|
|
||||||
uint32_t edi;
|
|
||||||
uint32_t ebp;
|
|
||||||
uint32_t esp;
|
|
||||||
uint32_t eip;
|
|
||||||
#elif defined(__x86_64__)
|
|
||||||
uint64_t rbx;
|
uint64_t rbx;
|
||||||
uint64_t r12;
|
uint64_t r12;
|
||||||
uint64_t r13;
|
uint64_t r13;
|
||||||
|
@ -52,9 +45,7 @@ typedef struct __jmp_buf sigjmp_buf[1];
|
||||||
* Since setjmp.h may be included by ports written in C, we need to guard this.
|
* Since setjmp.h may be included by ports written in C, we need to guard this.
|
||||||
*/
|
*/
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# ifdef __i386__
|
# if defined(__x86_64__)
|
||||||
static_assert(sizeof(struct __jmp_buf) == 32, "struct __jmp_buf unsynchronized with i386/setjmp.S");
|
|
||||||
# elif defined(__x86_64__)
|
|
||||||
static_assert(sizeof(struct __jmp_buf) == 72, "struct __jmp_buf unsynchronized with x86_64/setjmp.S");
|
static_assert(sizeof(struct __jmp_buf) == 72, "struct __jmp_buf unsynchronized with x86_64/setjmp.S");
|
||||||
# elif defined(__aarch64__)
|
# elif defined(__aarch64__)
|
||||||
static_assert(sizeof(struct __jmp_buf) == 184, "struct __jmp_buf unsynchronized with aarch64/setjmp.S");
|
static_assert(sizeof(struct __jmp_buf) == 184, "struct __jmp_buf unsynchronized with aarch64/setjmp.S");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue