sys/reg.h: derive __WORDSIZE from __LONG_MAX

this removes an otherwise-unnecessary bits header from most archs,
replacing it with an empty generic version.
This commit is contained in:
Rich Felker 2024-05-07 09:07:41 -04:00
parent 29b216b2f2
commit e709a6f07a
19 changed files with 9 additions and 42 deletions

View File

@ -1,2 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 64

View File

@ -1,3 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 32
/* FIXME */

0
arch/generic/bits/reg.h Normal file
View File

View File

@ -1,5 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 32
#define EBX 0
#define ECX 1
#define EDX 2

View File

@ -1,2 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 64

View File

@ -1,5 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 32
#define PT_D1 0
#define PT_D2 1
#define PT_D3 2

View File

@ -1,3 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 32
/* FIXME */

View File

@ -1,6 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 32
#define EF_R0 6
#define EF_R1 7
#define EF_R2 8

View File

@ -1,6 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 64
#define EF_R0 0
#define EF_R1 1
#define EF_R2 2

View File

@ -1,6 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 64
#define EF_R0 0
#define EF_R1 1
#define EF_R2 2

View File

@ -1,3 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 32
/* FIXME */

View File

@ -1,3 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 32
/* FIXME */

View File

@ -1,3 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 64
/* FIXME */

View File

@ -1,2 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 32

View File

@ -1,2 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 64

View File

@ -1,2 +0,0 @@
#undef __WORDSIZE
#define __WORDSIZE 64

View File

@ -1,5 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 32
#define R15 0
#define R14 1
#define R13 2

View File

@ -1,5 +1,3 @@
#undef __WORDSIZE
#define __WORDSIZE 64
#define R15 0
#define R14 1
#define R13 2

View File

@ -4,6 +4,15 @@
#include <limits.h>
#include <unistd.h>
#include <bits/alltype.h>
#undef __WORDSIZE
#if __LONG_MAX == 0x7fffffffL
#define __WORDSIZE 32
#else
#define __WORDSIZE 64
#endif
#include <bits/reg.h>
#endif