Skip to content

Commit 8f03217

Browse files
authored
Merge pull request #23497 from alexrp/hexagon
Some `hexagon-linux` porting work
2 parents 4b63f94 + d01f2aa commit 8f03217

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7459
-62
lines changed

lib/libc/include/hexagon-linux-musl/bits/alltypes.h

Lines changed: 409 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#define FE_INVALID (1 << 1)
2+
#define FE_DIVBYZERO (1 << 2)
3+
#define FE_OVERFLOW (1 << 3)
4+
#define FE_UNDERFLOW (1 << 4)
5+
#define FE_INEXACT (1 << 5)
6+
#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
7+
FE_OVERFLOW | FE_UNDERFLOW)
8+
9+
#define FE_TONEAREST 0x00
10+
#define FE_TOWARDZERO 0x01
11+
#define FE_DOWNWARD 0x02
12+
#define FE_UPWARD 0x03
13+
14+
typedef unsigned long fexcept_t;
15+
16+
typedef struct {
17+
unsigned long __cw;
18+
} fenv_t;
19+
20+
#define FE_DFL_ENV ((const fenv_t *) -1)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#define FLT_EVAL_METHOD 0
2+
3+
#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4+
#define LDBL_MIN 2.22507385850720138309e-308L
5+
#define LDBL_MAX 1.79769313486231570815e+308L
6+
#define LDBL_EPSILON 2.22044604925031308085e-16L
7+
8+
#define LDBL_MANT_DIG 53
9+
#define LDBL_MIN_EXP (-1021)
10+
#define LDBL_MAX_EXP 1024
11+
12+
#define LDBL_DIG 15
13+
#define LDBL_MIN_10_EXP (-307)
14+
#define LDBL_MAX_10_EXP 308
15+
16+
#define DECIMAL_DIG 17
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define IPC_STAT 0x102
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
struct msqid_ds {
2+
struct ipc_perm msg_perm;
3+
unsigned long __msg_stime_lo;
4+
unsigned long __msg_stime_hi;
5+
unsigned long __msg_rtime_lo;
6+
unsigned long __msg_rtime_hi;
7+
unsigned long __msg_ctime_lo;
8+
unsigned long __msg_ctime_hi;
9+
unsigned long msg_cbytes;
10+
msgqnum_t msg_qnum;
11+
msglen_t msg_qbytes;
12+
pid_t msg_lspid;
13+
pid_t msg_lrpid;
14+
unsigned long __unused[2];
15+
time_t msg_stime;
16+
time_t msg_rtime;
17+
time_t msg_ctime;
18+
};

lib/libc/include/hexagon-linux-musl/bits/reg.h

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct semid_ds {
2+
struct ipc_perm sem_perm;
3+
unsigned long __sem_otime_lo;
4+
unsigned long __sem_otime_hi;
5+
unsigned long __sem_ctime_lo;
6+
unsigned long __sem_ctime_hi;
7+
unsigned short sem_nsems;
8+
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
9+
long __unused3;
10+
long __unused4;
11+
time_t sem_otime;
12+
time_t sem_ctime;
13+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typedef long long __jmp_buf[8];
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#define SHMLBA 4096
2+
3+
struct shmid_ds {
4+
struct ipc_perm shm_perm;
5+
size_t shm_segsz;
6+
unsigned long __shm_atime_lo;
7+
unsigned long __shm_atime_hi;
8+
unsigned long __shm_dtime_lo;
9+
unsigned long __shm_dtime_hi;
10+
unsigned long __shm_ctime_lo;
11+
unsigned long __shm_ctime_hi;
12+
pid_t shm_cpid;
13+
pid_t shm_lpid;
14+
unsigned long shm_nattch;
15+
unsigned long __pad1;
16+
unsigned long __pad2;
17+
unsigned long __pad3;
18+
time_t shm_atime;
19+
time_t shm_dtime;
20+
time_t shm_ctime;
21+
};
22+
23+
struct shminfo {
24+
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25+
};
26+
27+
struct shm_info {
28+
int __used_ids;
29+
unsigned long shm_tot, shm_rss, shm_swp;
30+
unsigned long __swap_attempts, __swap_successes;
31+
};
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2+
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3+
4+
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5+
#define MINSIGSTKSZ 2048
6+
#define SIGSTKSZ 8192
7+
#endif
8+
9+
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10+
typedef int greg_t, gregset_t[18];
11+
typedef struct sigcontext
12+
{
13+
unsigned long r0, r1, r2, r3;
14+
unsigned long r4, r5, r6, r7;
15+
unsigned long r8, r9, r10, r11;
16+
unsigned long r12, r13, r14, r15;
17+
unsigned long r16, r17, r18, r19;
18+
unsigned long r20, r21, r22, r23;
19+
unsigned long r24, r25, r26, r27;
20+
unsigned long r28, r29, r30, r31;
21+
unsigned long sa0;
22+
unsigned long lc0;
23+
unsigned long sa1;
24+
unsigned long lc1;
25+
unsigned long m0;
26+
unsigned long m1;
27+
unsigned long usr;
28+
unsigned long p3_0;
29+
unsigned long gp;
30+
unsigned long ugp;
31+
unsigned long pc;
32+
unsigned long cause;
33+
unsigned long badva;
34+
unsigned long pad1;
35+
unsigned long long pad2;
36+
} mcontext_t;
37+
#else
38+
typedef struct {
39+
unsigned long __regs[48];
40+
} __attribute__((__aligned__(8))) mcontext_t;
41+
#endif
42+
43+
struct sigaltstack {
44+
void *ss_sp;
45+
int ss_flags;
46+
size_t ss_size;
47+
};
48+
49+
typedef struct __ucontext {
50+
unsigned long uc_flags;
51+
struct __ucontext *uc_link;
52+
stack_t uc_stack;
53+
mcontext_t uc_mcontext;
54+
sigset_t uc_sigmask;
55+
} ucontext_t;
56+
57+
#define SA_NOCLDSTOP 1
58+
#define SA_NOCLDWAIT 2
59+
#define SA_SIGINFO 4
60+
#define SA_ONSTACK 0x08000000
61+
#define SA_RESTART 0x10000000
62+
#define SA_NODEFER 0x40000000
63+
#define SA_RESETHAND 0x80000000
64+
#define SA_RESTORER 0x04000000
65+
66+
#endif
67+
68+
#define SIGHUP 1
69+
#define SIGINT 2
70+
#define SIGQUIT 3
71+
#define SIGILL 4
72+
#define SIGTRAP 5
73+
#define SIGABRT 6
74+
#define SIGIOT SIGABRT
75+
#define SIGBUS 7
76+
#define SIGFPE 8
77+
#define SIGKILL 9
78+
#define SIGUSR1 10
79+
#define SIGSEGV 11
80+
#define SIGUSR2 12
81+
#define SIGPIPE 13
82+
#define SIGALRM 14
83+
#define SIGTERM 15
84+
#define SIGSTKFLT 16
85+
#define SIGCHLD 17
86+
#define SIGCONT 18
87+
#define SIGSTOP 19
88+
#define SIGTSTP 20
89+
#define SIGTTIN 21
90+
#define SIGTTOU 22
91+
#define SIGURG 23
92+
#define SIGXCPU 24
93+
#define SIGXFSZ 25
94+
#define SIGVTALRM 26
95+
#define SIGPROF 27
96+
#define SIGWINCH 28
97+
#define SIGIO 29
98+
#define SIGPOLL 29
99+
#define SIGPWR 30
100+
#define SIGSYS 31
101+
#define SIGUNUSED SIGSYS
102+
103+
#define _NSIG 65

0 commit comments

Comments
 (0)