Revisión | 6bf05be30c6d695347ab02b18d20527bbdb3a1c5 (tree) |
---|---|
Tiempo | 2022-11-30 13:00:26 |
Autor | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
RX support
@@ -40,6 +40,7 @@ choice | ||
40 | 40 | default TARGET_powerpc if DESIRED_TARGET_ARCH = "powerpc" |
41 | 41 | default TARGET_riscv64 if DESIRED_TARGET_ARCH = "riscv64" |
42 | 42 | default TARGET_riscv32 if DESIRED_TARGET_ARCH = "riscv32" |
43 | + default TARGET_rx if DESIRED_TARGET_ARCH = "rx" | |
43 | 44 | default TARGET_sh if DESIRED_TARGET_ARCH = "sh" |
44 | 45 | default TARGET_sparc if DESIRED_TARGET_ARCH = "sparc" |
45 | 46 | default TARGET_sparc64 if DESIRED_TARGET_ARCH = "sparc64" |
@@ -129,6 +130,9 @@ config TARGET_riscv64 | ||
129 | 130 | config TARGET_riscv32 |
130 | 131 | bool "riscv32" |
131 | 132 | |
133 | +config TARGET_rx | |
134 | + bool "RX" | |
135 | + | |
132 | 136 | config TARGET_sh |
133 | 137 | bool "superh" |
134 | 138 |
@@ -268,6 +272,10 @@ if TARGET_riscv32 | ||
268 | 272 | source "extra/Configs/Config.riscv32" |
269 | 273 | endif |
270 | 274 | |
275 | +if TARGET_rx | |
276 | +source "extra/Configs/Config.rx" | |
277 | +endif | |
278 | + | |
271 | 279 | if TARGET_sh |
272 | 280 | source "extra/Configs/Config.sh" |
273 | 281 | endif |
@@ -0,0 +1,15 @@ | ||
1 | +# | |
2 | +# For a description of the syntax of this configuration file, | |
3 | +# see extra/config/Kconfig-language.txt | |
4 | +# | |
5 | + | |
6 | +config TARGET_ARCH | |
7 | + string | |
8 | + default "rx" | |
9 | + | |
10 | +config FORCE_OPTIONS_FOR_ARCH | |
11 | + bool | |
12 | + default y | |
13 | + select ARCH_LITTLE_ENDIAN | |
14 | + select ARCH_HAS_NO_MMU | |
15 | + select HAVE_NO_PIC |
@@ -0,0 +1,13 @@ | ||
1 | +# Makefile for uClibc | |
2 | +# | |
3 | +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> | |
4 | +# | |
5 | +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | |
6 | +# | |
7 | + | |
8 | +top_srcdir=../../../../ | |
9 | +top_builddir=../../../../ | |
10 | +all: objs | |
11 | +include $(top_builddir)Rules.mak | |
12 | +include Makefile.arch | |
13 | +include $(top_srcdir)Makerules |
@@ -0,0 +1,10 @@ | ||
1 | +# Makefile for uClibc | |
2 | +# | |
3 | +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> | |
4 | +# | |
5 | +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | |
6 | +# | |
7 | + | |
8 | +CSRC := __syscall_error.c | |
9 | + | |
10 | +SSRC := __longjmp.S _setjmp.S clone.S crt1.S setjmp.S vfork.S |
@@ -0,0 +1,30 @@ | ||
1 | +#define _ASM | |
2 | +#define _SETJMP_H | |
3 | +#include <features.h> | |
4 | +#include <bits/setjmp.h> | |
5 | + | |
6 | +.globl _longjmp | |
7 | +.type _longjmp,@function | |
8 | + | |
9 | + .text | |
10 | + .align 4 | |
11 | +_longjmp: | |
12 | + tst r2,r2 | |
13 | + scz.l r2 | |
14 | + mov.l [r1+],r6 | |
15 | + mov.l [r1+],r7 | |
16 | + mov.l [r1+],r8 | |
17 | + mov.l [r1+],r9 | |
18 | + mov.l [r1+],r10 | |
19 | + mov.l [r1+],r11 | |
20 | + mov.l [r1+],r12 | |
21 | + mov.l [r1+],r13 | |
22 | + mov.l [r1+],r14 | |
23 | + mov.l [r1+],r15 | |
24 | + mov.l 4[r1],r3 | |
25 | + mov.l r2,r1 | |
26 | + add [r1],r0 | |
27 | + jmp r3 | |
28 | + | |
29 | +libc_hidden_def(_longjmp) | |
30 | + .end |
@@ -0,0 +1,18 @@ | ||
1 | +/* Wrapper for setting errno. | |
2 | + * | |
3 | + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> | |
4 | + * | |
5 | + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | |
6 | + */ | |
7 | + | |
8 | +#include <features.h> | |
9 | +#include <errno.h> | |
10 | + | |
11 | +/* This routine is jumped to by all the syscall handlers, to stash | |
12 | + * an error number into errno. */ | |
13 | +int __syscall_error(int err_no) attribute_hidden; | |
14 | +int __syscall_error(int err_no) | |
15 | +{ | |
16 | + __set_errno(-err_no); | |
17 | + return -1; | |
18 | +} |
@@ -0,0 +1,26 @@ | ||
1 | +#define _ASM | |
2 | +#define _SETJMP_H | |
3 | +#include <bits/setjmp.h> | |
4 | + | |
5 | +.globl _setjmp | |
6 | +.type _setjmp,@function | |
7 | + | |
8 | + .text | |
9 | + .align 4 | |
10 | +_setjmp: | |
11 | + mov.l r6,[r1+] | |
12 | + mov.l r7,[r1+] | |
13 | + mov.l r8,[r1+] | |
14 | + mov.l r9,[r1+] | |
15 | + mov.l r10,[r1+] | |
16 | + mov.l r11,[r1+] | |
17 | + mov.l r12,[r1+] | |
18 | + mov.l r13,[r1+] | |
19 | + mov.l r14,[r1+] | |
20 | + mov.l r15,[r1+] | |
21 | + mov.l r0,[r1+] | |
22 | + mov.l [r0],[r1] | |
23 | + mov.l #0,4[r1] /* signal mask not saved */ | |
24 | + rts | |
25 | + | |
26 | + .end |
@@ -0,0 +1,40 @@ | ||
1 | +/* Macros to swap the order of bytes in integer values. m68k version. | |
2 | + Copyright (C) 1997, 2002 Free Software Foundation, Inc. | |
3 | + This file is part of the GNU C Library. | |
4 | + | |
5 | + The GNU C Library is free software; you can redistribute it and/or | |
6 | + modify it under the terms of the GNU Lesser General Public | |
7 | + License as published by the Free Software Foundation; either | |
8 | + version 2.1 of the License, or (at your option) any later version. | |
9 | + | |
10 | + The GNU C Library is distributed in the hope that it will be useful, | |
11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | + Lesser General Public License for more details. | |
14 | + | |
15 | + You should have received a copy of the GNU Lesser General Public | |
16 | + License along with the GNU C Library; if not, write to the Free | |
17 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
18 | + 02111-1307 USA. */ | |
19 | + | |
20 | +#ifndef _ASM_BITS_BYTESWAP_H | |
21 | +#define _ASM_BITS_BYTESWAP_H 1 | |
22 | + | |
23 | +# define __bswap_non_constant_32(x) \ | |
24 | + __extension__ \ | |
25 | + ({ unsigned int __bswap_32_v; \ | |
26 | + __asm__ __volatile__ ("revl %1,%0" \ | |
27 | + : "=r" (__bswap_32_v) \ | |
28 | + : "r" ((unsigned int) (x))); \ | |
29 | + __bswap_32_v; }) | |
30 | + | |
31 | +# define __bswap_non_constant_16(x) \ | |
32 | + __extension__ \ | |
33 | + ({ unsigned short __bswap_16_v; \ | |
34 | + __asm__ __volatile__ ("revw %1,%0" \ | |
35 | + : "=r" (__bswap_16_v) \ | |
36 | + : "r" ((unsigned short) (x))); \ | |
37 | + __bswap_16_v; }) | |
38 | +#endif | |
39 | + | |
40 | +#include <bits/byteswap-common.h> |
@@ -0,0 +1,7 @@ | ||
1 | +/* m68k is big-endian. */ | |
2 | + | |
3 | +#ifndef _ENDIAN_H | |
4 | +# error "Never use <bits/endian.h> directly; include <endian.h> instead." | |
5 | +#endif | |
6 | + | |
7 | +#define __BYTE_ORDER __LITTLE_ENDIAN |
@@ -0,0 +1,238 @@ | ||
1 | +/* O_*, F_*, FD_* bit values for Linux. | |
2 | + Copyright (C) 2000, 2004 Free Software Foundation, Inc. | |
3 | + This file is part of the GNU C Library. | |
4 | + | |
5 | + The GNU C Library is free software; you can redistribute it and/or | |
6 | + modify it under the terms of the GNU Lesser General Public | |
7 | + License as published by the Free Software Foundation; either | |
8 | + version 2.1 of the License, or (at your option) any later version. | |
9 | + | |
10 | + The GNU C Library is distributed in the hope that it will be useful, | |
11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | + Lesser General Public License for more details. | |
14 | + | |
15 | + You should have received a copy of the GNU Lesser General Public | |
16 | + License along with the GNU C Library; if not, write to the Free | |
17 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
18 | + 02111-1307 USA. */ | |
19 | + | |
20 | +#ifndef _FCNTL_H | |
21 | +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." | |
22 | +#endif | |
23 | + | |
24 | + | |
25 | +#include <sys/types.h> | |
26 | +#ifdef __USE_GNU | |
27 | +# include <bits/uio.h> | |
28 | +#endif | |
29 | + | |
30 | +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files | |
31 | + located on an ext2 file system */ | |
32 | +#define O_ACCMODE 0003 | |
33 | +#define O_RDONLY 00 | |
34 | +#define O_WRONLY 01 | |
35 | +#define O_RDWR 02 | |
36 | +#define O_CREAT 0100 /* not fcntl */ | |
37 | +#define O_EXCL 0200 /* not fcntl */ | |
38 | +#define O_NOCTTY 0400 /* not fcntl */ | |
39 | +#define O_TRUNC 01000 /* not fcntl */ | |
40 | +#define O_APPEND 02000 | |
41 | +#define O_NONBLOCK 04000 | |
42 | +#define O_NDELAY O_NONBLOCK | |
43 | +#define O_SYNC 010000 | |
44 | +#define O_FSYNC O_SYNC | |
45 | +#define O_ASYNC 020000 | |
46 | + | |
47 | +#ifdef __USE_GNU | |
48 | +# define O_DIRECTORY 040000 /* Must be a directory. */ | |
49 | +# define O_NOFOLLOW 0100000 /* Do not follow links. */ | |
50 | +# define O_DIRECT 0200000 /* Direct disk access. */ | |
51 | +# define O_NOATIME 01000000 /* Do not set atime. */ | |
52 | +# define O_CLOEXEC 02000000 /* set close_on_exec */ | |
53 | +#endif | |
54 | + | |
55 | +/* For now Linux has synchronisity options for data and read operations. | |
56 | + We define the symbols here but let them do the same as O_SYNC since | |
57 | + this is a superset. */ | |
58 | +#if defined __USE_POSIX199309 || defined __USE_UNIX98 | |
59 | +# define O_DSYNC O_SYNC /* Synchronize data. */ | |
60 | +# define O_RSYNC O_SYNC /* Synchronize read operations. */ | |
61 | +#endif | |
62 | + | |
63 | +#ifdef __USE_LARGEFILE64 | |
64 | +# define O_LARGEFILE 0400000 | |
65 | +#endif | |
66 | + | |
67 | +/* Values for the second argument to `fcntl'. */ | |
68 | +#define F_DUPFD 0 /* Duplicate file descriptor. */ | |
69 | +#define F_GETFD 1 /* Get file descriptor flags. */ | |
70 | +#define F_SETFD 2 /* Set file descriptor flags. */ | |
71 | +#define F_GETFL 3 /* Get file status flags. */ | |
72 | +#define F_SETFL 4 /* Set file status flags. */ | |
73 | +#ifndef __USE_FILE_OFFSET64 | |
74 | +# define F_GETLK 5 /* Get record locking info. */ | |
75 | +# define F_SETLK 6 /* Set record locking info (non-blocking). */ | |
76 | +# define F_SETLKW 7 /* Set record locking info (blocking). */ | |
77 | +#else | |
78 | +# define F_GETLK F_GETLK64 /* Get record locking info. */ | |
79 | +# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ | |
80 | +# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ | |
81 | +#endif | |
82 | +#define F_GETLK64 12 /* Get record locking info. */ | |
83 | +#define F_SETLK64 13 /* Set record locking info (non-blocking). */ | |
84 | +#define F_SETLKW64 14 /* Set record locking info (blocking). */ | |
85 | + | |
86 | +#if defined __USE_BSD || defined __USE_UNIX98 | |
87 | +# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ | |
88 | +# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ | |
89 | +#endif | |
90 | + | |
91 | +#ifdef __USE_GNU | |
92 | +# define F_SETSIG 10 /* Set number of signal to be sent. */ | |
93 | +# define F_GETSIG 11 /* Get number of signal to be sent. */ | |
94 | +#endif | |
95 | + | |
96 | +#ifdef __USE_GNU | |
97 | +# define F_SETLEASE 1024 /* Set a lease. */ | |
98 | +# define F_GETLEASE 1025 /* Enquire what lease is active. */ | |
99 | +# define F_NOTIFY 1026 /* Request notfications on a directory. */ | |
100 | +# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with | |
101 | + close-on-exit set on new fd. */ | |
102 | +#endif | |
103 | + | |
104 | +/* For F_[GET|SET]FL. */ | |
105 | +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ | |
106 | + | |
107 | +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ | |
108 | +#define F_RDLCK 0 /* Read lock. */ | |
109 | +#define F_WRLCK 1 /* Write lock. */ | |
110 | +#define F_UNLCK 2 /* Remove lock. */ | |
111 | + | |
112 | +/* For old implementation of bsd flock(). */ | |
113 | +#define F_EXLCK 4 /* or 3 */ | |
114 | +#define F_SHLCK 8 /* or 4 */ | |
115 | + | |
116 | +#ifdef __USE_BSD | |
117 | +/* Operations for bsd flock(), also used by the kernel implementation. */ | |
118 | +# define LOCK_SH 1 /* shared lock */ | |
119 | +# define LOCK_EX 2 /* exclusive lock */ | |
120 | +# define LOCK_NB 4 /* or'd with one of the above to prevent | |
121 | + blocking */ | |
122 | +# define LOCK_UN 8 /* remove lock */ | |
123 | +#endif | |
124 | + | |
125 | +#ifdef __USE_GNU | |
126 | +# define LOCK_MAND 32 /* This is a mandatory flock: */ | |
127 | +# define LOCK_READ 64 /* ... which allows concurrent read operations. */ | |
128 | +# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ | |
129 | +# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ | |
130 | +#endif | |
131 | + | |
132 | +#ifdef __USE_GNU | |
133 | +/* Types of directory notifications that may be requested with F_NOTIFY. */ | |
134 | +# define DN_ACCESS 0x00000001 /* File accessed. */ | |
135 | +# define DN_MODIFY 0x00000002 /* File modified. */ | |
136 | +# define DN_CREATE 0x00000004 /* File created. */ | |
137 | +# define DN_DELETE 0x00000008 /* File removed. */ | |
138 | +# define DN_RENAME 0x00000010 /* File renamed. */ | |
139 | +# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ | |
140 | +# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ | |
141 | +#endif | |
142 | + | |
143 | +struct flock | |
144 | + { | |
145 | + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ | |
146 | + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ | |
147 | +#ifndef __USE_FILE_OFFSET64 | |
148 | + __off_t l_start; /* Offset where the lock begins. */ | |
149 | + __off_t l_len; /* Size of the locked area; zero means until EOF. */ | |
150 | +#else | |
151 | + __off64_t l_start; /* Offset where the lock begins. */ | |
152 | + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ | |
153 | +#endif | |
154 | + __pid_t l_pid; /* Process holding the lock. */ | |
155 | + }; | |
156 | + | |
157 | +#ifdef __USE_LARGEFILE64 | |
158 | +struct flock64 | |
159 | + { | |
160 | + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ | |
161 | + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ | |
162 | + __off64_t l_start; /* Offset where the lock begins. */ | |
163 | + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ | |
164 | + __pid_t l_pid; /* Process holding the lock. */ | |
165 | + }; | |
166 | +#endif | |
167 | + | |
168 | +/* Define some more compatibility macros to be backward compatible with | |
169 | + BSD systems which did not managed to hide these kernel macros. */ | |
170 | +#ifdef __USE_BSD | |
171 | +# define FAPPEND O_APPEND | |
172 | +# define FFSYNC O_FSYNC | |
173 | +# define FASYNC O_ASYNC | |
174 | +# define FNONBLOCK O_NONBLOCK | |
175 | +# define FNDELAY O_NDELAY | |
176 | +#endif /* Use BSD. */ | |
177 | + | |
178 | +/* Advise to `posix_fadvise'. */ | |
179 | +#ifdef __USE_XOPEN2K | |
180 | +# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ | |
181 | +# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ | |
182 | +# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ | |
183 | +# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ | |
184 | +# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ | |
185 | +# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ | |
186 | +#endif | |
187 | + | |
188 | + | |
189 | +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ | |
190 | +/* Flags for SYNC_FILE_RANGE. */ | |
191 | +# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages | |
192 | + in the range before performing the | |
193 | + write. */ | |
194 | +# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those | |
195 | + dirty pages in the range which are | |
196 | + not presently under writeback. */ | |
197 | +# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in | |
198 | + the range after performing the | |
199 | + write. */ | |
200 | + | |
201 | +/* Flags for SPLICE and VMSPLICE. */ | |
202 | +# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ | |
203 | +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing | |
204 | + (but we may still block on the fd | |
205 | + we splice from/to). */ | |
206 | +# define SPLICE_F_MORE 4 /* Expect more data. */ | |
207 | +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ | |
208 | +#endif | |
209 | + | |
210 | +__BEGIN_DECLS | |
211 | + | |
212 | +#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ | |
213 | + | |
214 | +/* Provide kernel hint to read ahead. */ | |
215 | +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) | |
216 | + __THROW; | |
217 | + | |
218 | + | |
219 | +/* Selective file content synch'ing. */ | |
220 | +extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, | |
221 | + unsigned int __flags); | |
222 | + | |
223 | +/* Splice address range into a pipe. */ | |
224 | +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, | |
225 | + size_t __count, unsigned int __flags); | |
226 | + | |
227 | +/* Splice two files together. */ | |
228 | +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, | |
229 | + __off64_t *__offout, size_t __len, | |
230 | + unsigned int __flags); | |
231 | + | |
232 | +/* In-kernel implementation of tee for pipe buffers. */ | |
233 | +extern ssize_t tee (int __fdin, int __fdout, size_t __len, | |
234 | + unsigned int __flags); | |
235 | + | |
236 | +#endif | |
237 | +__END_DECLS | |
238 | + |
@@ -0,0 +1,79 @@ | ||
1 | +/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +#ifndef _FENV_H | |
20 | +# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." | |
21 | +#endif | |
22 | + | |
23 | + | |
24 | +/* Define bits representing the exception. We use the bit positions of | |
25 | + the appropriate bits in the FPSR Accrued Exception Byte. */ | |
26 | +enum | |
27 | + { | |
28 | + FE_INEXACT = 1 << 3, | |
29 | +#define FE_INEXACT FE_INEXACT | |
30 | + FE_DIVBYZERO = 1 << 4, | |
31 | +#define FE_DIVBYZERO FE_DIVBYZERO | |
32 | + FE_UNDERFLOW = 1 << 5, | |
33 | +#define FE_UNDERFLOW FE_UNDERFLOW | |
34 | + FE_OVERFLOW = 1 << 6, | |
35 | +#define FE_OVERFLOW FE_OVERFLOW | |
36 | + FE_INVALID = 1 << 7 | |
37 | +#define FE_INVALID FE_INVALID | |
38 | + }; | |
39 | + | |
40 | +#define FE_ALL_EXCEPT \ | |
41 | + (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) | |
42 | + | |
43 | +/* The m68k FPU supports all of the four defined rounding modes. We use | |
44 | + the bit positions in the FPCR Mode Control Byte as the values for the | |
45 | + appropriate macros. */ | |
46 | +enum | |
47 | + { | |
48 | + FE_TONEAREST = 0, | |
49 | +#define FE_TONEAREST FE_TONEAREST | |
50 | + FE_TOWARDZERO = 1 << 4, | |
51 | +#define FE_TOWARDZERO FE_TOWARDZERO | |
52 | + FE_DOWNWARD = 2 << 4, | |
53 | +#define FE_DOWNWARD FE_DOWNWARD | |
54 | + FE_UPWARD = 3 << 4 | |
55 | +#define FE_UPWARD FE_UPWARD | |
56 | + }; | |
57 | + | |
58 | + | |
59 | +/* Type representing exception flags. */ | |
60 | +typedef unsigned int fexcept_t; | |
61 | + | |
62 | + | |
63 | +/* Type representing floating-point environment. This structure | |
64 | + corresponds to the layout of the block written by `fmovem'. */ | |
65 | +typedef struct | |
66 | + { | |
67 | + unsigned int __control_register; | |
68 | + unsigned int __status_register; | |
69 | + unsigned int __instruction_address; | |
70 | + } | |
71 | +fenv_t; | |
72 | + | |
73 | +/* If the default argument is used we use this value. */ | |
74 | +#define FE_DFL_ENV ((__const fenv_t *) -1) | |
75 | + | |
76 | +#ifdef __USE_GNU | |
77 | +/* Floating-point environment where none of the exceptions are masked. */ | |
78 | +# define FE_NOMASK_ENV ((__const fenv_t *) -2) | |
79 | +#endif |
@@ -0,0 +1,56 @@ | ||
1 | +#ifndef _BITS_STAT_STRUCT_H | |
2 | +#define _BITS_STAT_STRUCT_H | |
3 | + | |
4 | +#ifndef _LIBC | |
5 | +#error bits/kernel_stat.h is for internal uClibc use only! | |
6 | +#endif | |
7 | + | |
8 | +/* This file provides whatever this particular arch's kernel thinks | |
9 | + * struct kernel_stat should look like... It turns out each arch has a | |
10 | + * different opinion on the subject... */ | |
11 | + | |
12 | +struct kernel_stat { | |
13 | + unsigned short st_dev; | |
14 | + unsigned short __pad1; | |
15 | + unsigned long st_ino; | |
16 | + unsigned short st_mode; | |
17 | + unsigned short st_nlink; | |
18 | + unsigned short st_uid; | |
19 | + unsigned short st_gid; | |
20 | + unsigned short st_rdev; | |
21 | + unsigned short __pad2; | |
22 | + unsigned long st_size; | |
23 | + unsigned long st_blksize; | |
24 | + unsigned long st_blocks; | |
25 | + struct timespec st_atim; | |
26 | + struct timespec st_mtim; | |
27 | + struct timespec st_ctim; | |
28 | + unsigned long __unused4; | |
29 | + unsigned long __unused5; | |
30 | +}; | |
31 | + | |
32 | +struct kernel_stat64 { | |
33 | + unsigned char __pad0[6]; | |
34 | + unsigned short st_dev; | |
35 | + unsigned char __pad1[2]; | |
36 | +#define _HAVE_STAT64___ST_INO | |
37 | + unsigned long __st_ino; | |
38 | + unsigned int st_mode; | |
39 | + unsigned int st_nlink; | |
40 | + unsigned long st_uid; | |
41 | + unsigned long st_gid; | |
42 | + unsigned char __pad2[6]; | |
43 | + unsigned short st_rdev; | |
44 | + unsigned char __pad3[2]; | |
45 | + long long st_size; | |
46 | + unsigned long st_blksize; | |
47 | + unsigned long __pad4; /* future possible st_blocks high bits */ | |
48 | + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ | |
49 | + struct timespec st_atim; | |
50 | + struct timespec st_mtim; | |
51 | + struct timespec st_ctim; | |
52 | + unsigned long long st_ino; | |
53 | +}; | |
54 | + | |
55 | +#endif /* _BITS_STAT_STRUCT_H */ | |
56 | + |
@@ -0,0 +1 @@ | ||
1 | +#include <asm-generic/posix_types.h> |
@@ -0,0 +1,43 @@ | ||
1 | +/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +#ifndef _SYS_POLL_H | |
20 | +# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." | |
21 | +#endif | |
22 | + | |
23 | +/* Event types that can be polled for. These bits may be set in `events' | |
24 | + to indicate the interesting event types; they will appear in `revents' | |
25 | + to indicate the status of the file descriptor. */ | |
26 | +#define POLLIN 0x001 /* There is data to read. */ | |
27 | +#define POLLPRI 0x002 /* There is urgent data to read. */ | |
28 | +#define POLLOUT 0x004 /* Writing now will not block. */ | |
29 | + | |
30 | +#ifdef __USE_XOPEN | |
31 | +/* These values are defined in XPG4.2. */ | |
32 | +# define POLLRDNORM 0x040 /* Normal data may be read. */ | |
33 | +# define POLLRDBAND 0x080 /* Priority data may be read. */ | |
34 | +# define POLLWRNORM POLLOUT /* Writing now will not block. */ | |
35 | +# define POLLWRBAND 0x100 /* Priority data may be written. */ | |
36 | +#endif | |
37 | + | |
38 | +/* Event types always implicitly polled for. These bits need not be set in | |
39 | + `events', but they will appear in `revents' to indicate the status of | |
40 | + the file descriptor. */ | |
41 | +#define POLLERR 0x008 /* Error condition. */ | |
42 | +#define POLLHUP 0x010 /* Hung up. */ | |
43 | +#define POLLNVAL 0x020 /* Invalid polling request. */ |
@@ -0,0 +1,41 @@ | ||
1 | +/* Copyright (C) 1997,1998,2005,2006 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +/* Define the machine-dependent type `jmp_buf'. m68k version. */ | |
20 | +#ifndef _BITS_SETJMP_H | |
21 | +#define _BITS_SETJMP_H 1 | |
22 | + | |
23 | +#if !defined _SETJMP_H && !defined _PTHREAD_H | |
24 | +# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." | |
25 | +#endif | |
26 | + | |
27 | +#ifndef _ASM | |
28 | + | |
29 | +typedef struct | |
30 | + { | |
31 | + unsigned long r[10]; /* r6 - r15 */ | |
32 | + unsigned long pc; | |
33 | + unsigned long sp; | |
34 | + } __jmp_buf[1]; | |
35 | + | |
36 | +#endif | |
37 | + | |
38 | +#define _JMPBUF_UNWINDS(jmpbuf, address) \ | |
39 | + ((void *) (address) < (void *) (jmpbuf)->r[6]) | |
40 | + | |
41 | +#endif /* bits/setjmp.h */ |
@@ -0,0 +1,26 @@ | ||
1 | +/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>, 1998. | |
4 | + | |
5 | + The GNU C Library is free software; you can redistribute it and/or | |
6 | + modify it under the terms of the GNU Lesser General Public | |
7 | + License as published by the Free Software Foundation; either | |
8 | + version 2.1 of the License, or (at your option) any later version. | |
9 | + | |
10 | + The GNU C Library is distributed in the hope that it will be useful, | |
11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | + Lesser General Public License for more details. | |
14 | + | |
15 | + You should have received a copy of the GNU Lesser General Public | |
16 | + License along with the GNU C Library; if not, write to the Free | |
17 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
18 | + 02111-1307 USA. */ | |
19 | + | |
20 | +#define SIGCONTEXT int _code, struct sigcontext * | |
21 | +#define SIGCONTEXT_EXTRA_ARGS _code, | |
22 | +#define GET_PC(ctx) ((void *) (ctx)->sc_pc) | |
23 | +#define GET_FRAME(ctx) ((void *) __builtin_frame_address (1)) | |
24 | +#define GET_STACK(ctx) ((void *) (ctx)->sc_usp) | |
25 | +#define CALL_SIGHANDLER(handler, signo, ctx) \ | |
26 | + (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) |
@@ -0,0 +1,27 @@ | ||
1 | +/* Copyright (C) 1999 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +/* This file contains a bit of information about the stack allocation | |
20 | + of the processor. */ | |
21 | + | |
22 | +#ifndef _STACKINFO_H | |
23 | +#define _STACKINFO_H 1 | |
24 | + | |
25 | +#define _STACK_GROWS_DOWN 1 | |
26 | + | |
27 | +#endif /* stackinfo.h */ |
@@ -0,0 +1,92 @@ | ||
1 | +#ifndef _BITS_SYSCALLS_H | |
2 | +#define _BITS_SYSCALLS_H | |
3 | +#ifndef _SYSCALL_H | |
4 | +# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead." | |
5 | +#endif | |
6 | + | |
7 | +#undef __NR_iopl | |
8 | +#undef __NR_vm86 | |
9 | + | |
10 | +#ifndef __ASSEMBLER__ | |
11 | + | |
12 | +#define ASM_ARGS_0 | |
13 | +#define ARGS_0(name, dummy) \ | |
14 | + register unsigned long r1 __asm__("r1"); \ | |
15 | + register unsigned long r15 __asm__("r15") = name | |
16 | + | |
17 | +#define ASM_ARGS_1 , "0"(r1) | |
18 | +#define ARGS_1(name, a1) \ | |
19 | + unsigned long __arg1 = (unsigned long)a1; \ | |
20 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
21 | + register unsigned long r15 __asm__("r15") = name | |
22 | + | |
23 | +#define ASM_ARGS_2 , "0"(r1), "r"(r2) | |
24 | +#define ARGS_2(name, a1, a2) \ | |
25 | + unsigned long __arg1 = (unsigned long)a1; \ | |
26 | + unsigned long __arg2 = (unsigned long)a2; \ | |
27 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
28 | + register unsigned long r2 __asm__("r2") = __arg2; \ | |
29 | + register unsigned long r15 __asm__("r15") = name | |
30 | + | |
31 | +#define ASM_ARGS_3 , "0"(r1), "r"(r2), "r"(r3) | |
32 | +#define ARGS_3(name, a1, a2, a3) \ | |
33 | + unsigned long __arg1 = (unsigned long)a1; \ | |
34 | + unsigned long __arg2 = (unsigned long)a2; \ | |
35 | + unsigned long __arg3 = (unsigned long)a3; \ | |
36 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
37 | + register unsigned long r2 __asm__("r2") = __arg2; \ | |
38 | + register unsigned long r3 __asm__("r3") = __arg3; \ | |
39 | + register unsigned long r15 __asm__("r15") = name | |
40 | + | |
41 | +#define ASM_ARGS_4 , "0"(r1), "r"(r2), "r"(r3), "r"(r4) | |
42 | +#define ARGS_4(name, a1, a2, a3, a4) \ | |
43 | + unsigned long __arg1 = (unsigned long)a1; \ | |
44 | + unsigned long __arg2 = (unsigned long)a2; \ | |
45 | + unsigned long __arg3 = (unsigned long)a3; \ | |
46 | + unsigned long __arg4 = (unsigned long)a4; \ | |
47 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
48 | + register unsigned long r2 __asm__("r2") = __arg2; \ | |
49 | + register unsigned long r3 __asm__("r3") = __arg3; \ | |
50 | + register unsigned long r4 __asm__("r4") = __arg4; \ | |
51 | + register unsigned long r15 __asm__("r15") = name | |
52 | + | |
53 | +#define ASM_ARGS_5 , "0"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5) | |
54 | +#define ARGS_5(name, a1, a2, a3, a4, a5) \ | |
55 | + unsigned long __arg1 = (unsigned long)a1; \ | |
56 | + unsigned long __arg2 = (unsigned long)a2; \ | |
57 | + unsigned long __arg3 = (unsigned long)a3; \ | |
58 | + unsigned long __arg4 = (unsigned long)a4; \ | |
59 | + unsigned long __arg5 = (unsigned long)a5; \ | |
60 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
61 | + register unsigned long r2 __asm__("r2") = __arg2; \ | |
62 | + register unsigned long r3 __asm__("r3") = __arg3; \ | |
63 | + register unsigned long r4 __asm__("r4") = __arg4; \ | |
64 | + register unsigned long r5 __asm__("r5") = __arg5; \ | |
65 | + register unsigned long r15 __asm__("r15") = name | |
66 | + | |
67 | +#define ASM_ARGS_6 , "0"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5), "r"(r7) | |
68 | +#define ARGS_6(name, a1, a2, a3, a4, a5, a6) \ | |
69 | + unsigned long __arg1 = (unsigned long)a1; \ | |
70 | + unsigned long __arg2 = (unsigned long)a2; \ | |
71 | + unsigned long __arg3 = (unsigned long)a3; \ | |
72 | + unsigned long __arg4 = (unsigned long)a4; \ | |
73 | + unsigned long __arg5 = (unsigned long)a5; \ | |
74 | + unsigned long __arg6 = (unsigned long)a6; \ | |
75 | + register unsigned long r1 __asm__("r1") = __arg1; \ | |
76 | + register unsigned long r2 __asm__("r2") = __arg2; \ | |
77 | + register unsigned long r3 __asm__("r3") = __arg3; \ | |
78 | + register unsigned long r4 __asm__("r4") = __arg4; \ | |
79 | + register unsigned long r5 __asm__("r5") = __arg5; \ | |
80 | + register unsigned long r7 __asm__("r7") = __arg6; \ | |
81 | + register unsigned long r15 __asm__("r15") = name | |
82 | + | |
83 | +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ | |
84 | + ({ ARGS_##nr (name, args); \ | |
85 | + __asm__ __volatile__ ("int #0x08\n\t" \ | |
86 | + : "=r"(r1) \ | |
87 | + : "r"(r15) ASM_ARGS_##nr \ | |
88 | + : "memory"); \ | |
89 | + (int)r1; }) | |
90 | + | |
91 | +#endif /* __ASSEMBLER__ */ | |
92 | +#endif /* _BITS_SYSCALLS_H */ |
@@ -0,0 +1,47 @@ | ||
1 | +/* | |
2 | + * Track misc arch-specific features that aren't config options | |
3 | + */ | |
4 | + | |
5 | +#ifndef _BITS_UCLIBC_ARCH_FEATURES_H | |
6 | +#define _BITS_UCLIBC_ARCH_FEATURES_H | |
7 | + | |
8 | +/* instruction used when calling abort() to kill yourself */ | |
9 | +#define __UCLIBC_ABORT_INSTRUCTION__ "wait" | |
10 | + | |
11 | +/* can your target use syscall6() for mmap ? */ | |
12 | +#define __UCLIBC_MMAP_HAS_6_ARGS__ | |
13 | + | |
14 | +/* does your target use syscall4() for truncate64 ? (32bit arches only) */ | |
15 | +#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__ | |
16 | + | |
17 | +/* does your target have a broken create_module() ? */ | |
18 | +#undef __UCLIBC_BROKEN_CREATE_MODULE__ | |
19 | + | |
20 | +/* does your target have to worry about older [gs]etrlimit() ? */ | |
21 | +#undef __UCLIBC_HANDLE_OLDER_RLIMIT__ | |
22 | + | |
23 | +/* does your target have an asm .set ? */ | |
24 | +#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__ | |
25 | + | |
26 | +/* define if target doesn't like .global */ | |
27 | +#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__ | |
28 | + | |
29 | +/* define if target supports .weak */ | |
30 | +#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__ | |
31 | + | |
32 | +/* define if target supports .weakext */ | |
33 | +#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__ | |
34 | + | |
35 | +/* needed probably only for ppc64 */ | |
36 | +#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__ | |
37 | + | |
38 | +/* define if target supports CFI pseudo ops */ | |
39 | +#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__ | |
40 | + | |
41 | +/* define if target supports IEEE signed zero floats */ | |
42 | +#define __UCLIBC_HAVE_SIGNED_ZERO__ | |
43 | + | |
44 | +/* only weird assemblers generally need this */ | |
45 | +#undef __UCLIBC_ASM_LINE_SEP__ | |
46 | + | |
47 | +#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */ |
@@ -0,0 +1,19 @@ | ||
1 | +/* Copyright (C) 1999 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +#define __WORDSIZE 32 |
@@ -0,0 +1,49 @@ | ||
1 | +#define _ERRNO_H | |
2 | +#include <features.h> | |
3 | +#include <bits/errno.h> | |
4 | +#include <sys/syscall.h> | |
5 | + | |
6 | +/* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ | |
7 | + | |
8 | +.type clone,@function | |
9 | +.globl clone | |
10 | + | |
11 | + .text | |
12 | + .align 4 | |
13 | +clone: | |
14 | + mov.l r8,[-r0] | |
15 | + mov.l #-EINVAL, r5 | |
16 | + tst r1,r1 /* fn NULL check */ | |
17 | + beq 2f | |
18 | + tst r2,r2 /* stack NULL check */ | |
19 | + | |
20 | + mov.l 8[r0],r5 | |
21 | + mov.l r5,[-r2] /* save arg to new stack */ | |
22 | + mov.l r1,[-r2] /* save fn to new stack */ | |
23 | + | |
24 | + mov.l r3,r1 | |
25 | + mov.l 12[r0],r3 /* parent_tidptr */ | |
26 | + mov.l 16[r0],r4 /* child_tidptr */ | |
27 | + mov.l #__NR_clone, r8 | |
28 | + int #0x08 | |
29 | + | |
30 | + mov.l r1,r5 | |
31 | + tst r1,r1 | |
32 | + bn 2f | |
33 | + beq 1f | |
34 | + mov.l [r0+],r8 | |
35 | + rts | |
36 | + | |
37 | +1: | |
38 | + mov.l [r0+],r2 | |
39 | + mov.l [r0+],r1 | |
40 | + jsr r2 | |
41 | + mov.l #_NR_exit,r8 | |
42 | + int #0x08 | |
43 | + | |
44 | +2: | |
45 | + mov.l [r0+],r8 | |
46 | + mov.l r5,r1 | |
47 | + bra __syscall_error | |
48 | + | |
49 | + .end |
@@ -0,0 +1,56 @@ | ||
1 | +/* Startup code for RX | |
2 | + Copyright (C) 1999 Free Software Foundation, Inc. | |
3 | + Copyright (C) 2010 Yoshinori Sato | |
4 | + | |
5 | + This program is free software; you can redistribute it and/or modify it under | |
6 | + the terms of the GNU Library General Public License as published by the Free | |
7 | + Software Foundation; either version 2 of the License, or (at your option) any | |
8 | + later version. | |
9 | + | |
10 | + This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
12 | + FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more | |
13 | + details. | |
14 | + | |
15 | + You should have received a copy of the GNU Library General Public License | |
16 | + along with this program; if not, write to the Free Software Foundation, Inc., | |
17 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | +*/ | |
19 | + | |
20 | +#include <features.h> | |
21 | + | |
22 | + .global _start | |
23 | + .global __exit | |
24 | + .global atexit | |
25 | + .global main | |
26 | + | |
27 | + .text | |
28 | + | |
29 | + /* r1: argc */ | |
30 | + /* r2: argv */ | |
31 | + /* r3: envp */ | |
32 | +_start: | |
33 | + bsr __uClibc_main | |
34 | + | |
35 | + /* If that didn't kill us, ... */ | |
36 | +__exit: | |
37 | + mov.l #1,r8 /* NR_exit */ | |
38 | + int #0x08 | |
39 | + | |
40 | +/* | |
41 | + * this was needed for gcc/g++-builds, atexit was not getting included | |
42 | + * for some stupid reason, this gets us a compiler | |
43 | + */ | |
44 | +empty_func: | |
45 | + rts | |
46 | + .weak atexit | |
47 | + atexit = empty_func | |
48 | + | |
49 | + | |
50 | +/* Define a symbol for the first piece of initialized data. */ | |
51 | + .data | |
52 | + .globl __data_start | |
53 | +__data_start: | |
54 | + .long 0 | |
55 | + .weak data_start | |
56 | + data_start = __data_start |
@@ -0,0 +1,25 @@ | ||
1 | + .file "crti.S" | |
2 | + .text | |
3 | + | |
4 | + .section .init | |
5 | + .hidden _init | |
6 | + .align 1 | |
7 | + .global _init | |
8 | + .type _init, @function | |
9 | +_init: | |
10 | + mov.l r6,[-r0] | |
11 | + mov.l r0,r6 | |
12 | + bra 1f | |
13 | + .align 1 | |
14 | +1: | |
15 | + .section .fini | |
16 | + .hidden _fini | |
17 | + .align 1 | |
18 | + .global _fini | |
19 | + .type _fini, @function | |
20 | +_fini: | |
21 | + mov.l r6,[-r0] | |
22 | + mov.l r0,r6 | |
23 | + bra 1f | |
24 | + .align 1 | |
25 | +1: |
@@ -0,0 +1,18 @@ | ||
1 | + .file "crtn.S" | |
2 | + .text | |
3 | + | |
4 | + .section .init | |
5 | + .hidden _init | |
6 | + .align 1 | |
7 | + .global _init | |
8 | + .type _init, @function | |
9 | + mov.l [r0+],r6 | |
10 | + rts | |
11 | + | |
12 | + .section .fini | |
13 | + .hidden _fini | |
14 | + .align 1 | |
15 | + .global _fini | |
16 | + .type _fini, @function | |
17 | + mov.l [r0+],r6 | |
18 | + rts |
@@ -0,0 +1,31 @@ | ||
1 | +#define _ASM | |
2 | +#define _SETJMP_H | |
3 | +#include <bits/setjmp.h> | |
4 | + | |
5 | +.globl setjmp | |
6 | +.type setjmp,@function | |
7 | +.globl __sigsetjmp | |
8 | +.type __sigsetjmp,@function | |
9 | + | |
10 | + .text | |
11 | + .align 4 | |
12 | +setjmp: | |
13 | + mov.l #1,r2 /* Always save sigmask */ | |
14 | +__sigsetjmp: | |
15 | + mov.l r6,[r1+] | |
16 | + mov.l r7,[r1+] | |
17 | + mov.l r8,[r1+] | |
18 | + mov.l r9,[r1+] | |
19 | + mov.l r10,[r1+] | |
20 | + mov.l r11,[r1+] | |
21 | + mov.l r12,[r1+] | |
22 | + mov.l r13,[r1+] | |
23 | + mov.l r14,[r1+] | |
24 | + mov.l r15,[r1+] | |
25 | + mov.l r0,[r1+] | |
26 | + mov.l [r0],[r1] | |
27 | + mov.l r2,4[r1] /* set mask_was_saved */ | |
28 | + mov.l #0,r1 | |
29 | + bra __sigjmp_save | |
30 | + | |
31 | + .end |
@@ -0,0 +1,122 @@ | ||
1 | +/* Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +#ifndef _SYS_PROCFS_H | |
20 | +#define _SYS_PROCFS_H 1 | |
21 | + | |
22 | +/* This is somewhat modelled after the file of the same name on SVR4 | |
23 | + systems. It provides a definition of the core file format for ELF | |
24 | + used on Linux. It doesn't have anything to do with the /proc file | |
25 | + system, even though Linux has one. | |
26 | + | |
27 | + Anyway, the whole purpose of this file is for GDB and GDB only. | |
28 | + Don't read too much into it. Don't use it for anything other than | |
29 | + GDB unless you know what you are doing. */ | |
30 | + | |
31 | +#include <features.h> | |
32 | +#include <sys/time.h> | |
33 | +#include <sys/types.h> | |
34 | +#include <sys/user.h> | |
35 | + | |
36 | +__BEGIN_DECLS | |
37 | + | |
38 | +/* Type for a general-purpose register. */ | |
39 | +typedef unsigned long elf_greg_t; | |
40 | + | |
41 | +/* And the whole bunch of them. We could have used `struct | |
42 | + user_regs_struct' directly in the typedef, but tradition says that | |
43 | + the register set is an array, which does have some peculiar | |
44 | + semantics, so leave it that way. */ | |
45 | +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | |
46 | +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
47 | + | |
48 | +/* Signal info. */ | |
49 | +struct elf_siginfo | |
50 | + { | |
51 | + int si_signo; /* Signal number. */ | |
52 | + int si_code; /* Extra code. */ | |
53 | + int si_errno; /* Errno. */ | |
54 | + }; | |
55 | + | |
56 | + | |
57 | +/* Definitions to generate Intel SVR4-like core files. These mostly | |
58 | + have the same names as the SVR4 types with "elf_" tacked on the | |
59 | + front to prevent clashes with Linux definitions, and the typedef | |
60 | + forms have been avoided. This is mostly like the SVR4 structure, | |
61 | + but more Linuxy, with things that Linux does not support and which | |
62 | + GDB doesn't really use excluded. */ | |
63 | + | |
64 | +struct elf_prstatus | |
65 | + { | |
66 | + struct elf_siginfo pr_info; /* Info associated with signal. */ | |
67 | + short int pr_cursig; /* Current signal. */ | |
68 | + unsigned long int pr_sigpend; /* Set of pending signals. */ | |
69 | + unsigned long int pr_sighold; /* Set of held signals. */ | |
70 | + __pid_t pr_pid; | |
71 | + __pid_t pr_ppid; | |
72 | + __pid_t pr_pgrp; | |
73 | + __pid_t pr_sid; | |
74 | + struct timeval pr_utime; /* User time. */ | |
75 | + struct timeval pr_stime; /* System time. */ | |
76 | + struct timeval pr_cutime; /* Cumulative user time. */ | |
77 | + struct timeval pr_cstime; /* Cumulative system time. */ | |
78 | + elf_gregset_t pr_reg; /* GP registers. */ | |
79 | + int pr_fpvalid; /* True if math copro being used. */ | |
80 | + }; | |
81 | + | |
82 | + | |
83 | +#define ELF_PRARGSZ (80) /* Number of chars for args. */ | |
84 | + | |
85 | +struct elf_prpsinfo | |
86 | + { | |
87 | + char pr_state; /* Numeric process state. */ | |
88 | + char pr_sname; /* Char for pr_state. */ | |
89 | + char pr_zomb; /* Zombie. */ | |
90 | + char pr_nice; /* Nice val. */ | |
91 | + unsigned long int pr_flag; /* Flags. */ | |
92 | + unsigned short int pr_uid; | |
93 | + unsigned short int pr_gid; | |
94 | + int pr_pid, pr_ppid, pr_pgrp, pr_sid; | |
95 | + /* Lots missing */ | |
96 | + char pr_fname[16]; /* Filename of executable. */ | |
97 | + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ | |
98 | + }; | |
99 | + | |
100 | + | |
101 | +/* The rest of this file provides the types for emulation of the | |
102 | + Solaris <proc_service.h> interfaces that should be implemented by | |
103 | + users of libthread_db. */ | |
104 | + | |
105 | +/* Addresses. */ | |
106 | +typedef void *psaddr_t; | |
107 | + | |
108 | +/* Register sets. Linux has different names. */ | |
109 | +typedef elf_gregset_t prgregset_t; | |
110 | +typedef elf_fpregset_t prfpregset_t; | |
111 | + | |
112 | +/* We don't have any differences between processes and threads, | |
113 | + therefore have only one PID type. */ | |
114 | +typedef __pid_t lwpid_t; | |
115 | + | |
116 | +/* Process status and info. In the end we do provide typedefs for them. */ | |
117 | +typedef struct elf_prstatus prstatus_t; | |
118 | +typedef struct elf_prpsinfo prpsinfo_t; | |
119 | + | |
120 | +__END_DECLS | |
121 | + | |
122 | +#endif /* sys/procfs.h */ |
@@ -0,0 +1,67 @@ | ||
1 | +/* Copyright (C) 1998 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +#ifndef _SYS_REG_H | |
20 | +#define _SYS_REG_H 1 | |
21 | + | |
22 | +/* Index into an array of 4 byte integers returned from ptrace for | |
23 | + location of the users' stored general purpose registers. */ | |
24 | + | |
25 | +enum | |
26 | +{ | |
27 | + PT_R1 = 0, | |
28 | +#define PT_R0 PT_R0 | |
29 | + PT_R1 = 1, | |
30 | +#define PT_R1 PT_R1 | |
31 | + PT_R2 = 2, | |
32 | +#define PT_R2 PT_R2 | |
33 | + PT_R3 = 3, | |
34 | +#define PT_R3 PT_R3 | |
35 | + PT_R4 = 4, | |
36 | +#define PT_R4 PT_R4 | |
37 | + PT_R5 = 5, | |
38 | +#define PT_R5 PT_R5 | |
39 | + PT_R6 = 6, | |
40 | +#define PT_R6 PT_R6 | |
41 | + PT_R7 = 7, | |
42 | +#define PT_R7 PT_R7 | |
43 | + PT_R8 = 8, | |
44 | +#define PT_R8 PT_R8 | |
45 | + PT_R9 = 9, | |
46 | +#define PT_R9 PT_R9 | |
47 | + PT_R10 = 10, | |
48 | +#define PT_R10 PT_R10 | |
49 | + PT_R11 = 11, | |
50 | +#define PT_R11 PT_R11 | |
51 | + PT_R12 = 12, | |
52 | +#define PT_R12 PT_R12 | |
53 | + PT_R13 = 13, | |
54 | +#define PT_R13 PT_R13 | |
55 | + PT_R14 = 14, | |
56 | +#define PT_R14 PT_R14 | |
57 | + PT_R15 = 15, | |
58 | +#define PT_R15 PT_15 | |
59 | + PT_USP = 16, | |
60 | +#define PT_USP PT_USP | |
61 | + PT_PC = 18, | |
62 | +#define PT_PC PT_PC | |
63 | + PT_PSW = 19, | |
64 | +#define PT_PSW PT_PSW | |
65 | +}; | |
66 | + | |
67 | +#endif /* _SYS_REG_H */ |
@@ -0,0 +1,93 @@ | ||
1 | +/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. | |
2 | + This file is part of the GNU C Library. | |
3 | + | |
4 | + The GNU C Library is free software; you can redistribute it and/or | |
5 | + modify it under the terms of the GNU Lesser General Public | |
6 | + License as published by the Free Software Foundation; either | |
7 | + version 2.1 of the License, or (at your option) any later version. | |
8 | + | |
9 | + The GNU C Library is distributed in the hope that it will be useful, | |
10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | + Lesser General Public License for more details. | |
13 | + | |
14 | + You should have received a copy of the GNU Lesser General Public | |
15 | + License along with the GNU C Library; if not, write to the Free | |
16 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | + 02111-1307 USA. */ | |
18 | + | |
19 | +/* System V/m68k ABI compliant context switching support. */ | |
20 | + | |
21 | +#ifndef _SYS_UCONTEXT_H | |
22 | +#define _SYS_UCONTEXT_H 1 | |
23 | + | |
24 | +#include <features.h> | |
25 | +#include <signal.h> | |
26 | + | |
27 | +/* Type for general register. */ | |
28 | +typedef int greg_t; | |
29 | + | |
30 | +/* Number of general registers. */ | |
31 | +#define NGREG 16 | |
32 | + | |
33 | +/* Container for all general registers. */ | |
34 | +typedef greg_t gregset_t[NGREG]; | |
35 | + | |
36 | +/* Number of each register is the `gregset_t' array. */ | |
37 | +enum | |
38 | +{ | |
39 | + R_R0 = 0, | |
40 | +#define R_R0 R_R0 | |
41 | + R_R1 = 1, | |
42 | +#define R_R1 R_R1 | |
43 | + R_R2 = 2, | |
44 | +#define R_R2 R_R2 | |
45 | + R_R3 = 3, | |
46 | +#define R_R3 R_R3 | |
47 | + R_R4 = 4, | |
48 | +#define R_R4 R_R4 | |
49 | + R_R5 = 5, | |
50 | +#define R_R5 R_R5 | |
51 | + R_R6 = 6, | |
52 | +#define R_R6 R_R6 | |
53 | + R_R7 = 7, | |
54 | +#define R_R7 R_R7 | |
55 | + R_R8 = 8, | |
56 | +#define R_R8 R_R8 | |
57 | + R_R9 = 9, | |
58 | +#define R_R9 R_R9 | |
59 | + R_R10 = 10, | |
60 | +#define R_R10 R_R10 | |
61 | + R_R11 = 11, | |
62 | +#define R_R11 R_R11 | |
63 | + R_R12 = 12, | |
64 | +#define R_R12 R_R12 | |
65 | + R_R13 = 13, | |
66 | +#define R_R13 R_R13 | |
67 | + R_R14 = 14, | |
68 | +#define R_R14 R_R14 | |
69 | + R_R15 = 15, | |
70 | +#define R_R15 R_15 | |
71 | +}; | |
72 | + | |
73 | +/* Context to describe whole processor state. */ | |
74 | +typedef struct | |
75 | +{ | |
76 | + gregset_t gregs; | |
77 | + unsigned int usp; | |
78 | + unsigned int vec; | |
79 | + unsigned int pc; | |
80 | + unsigned int psw; | |
81 | +} mcontext_t; | |
82 | + | |
83 | +/* Userlevel context. */ | |
84 | +typedef struct ucontext | |
85 | +{ | |
86 | + unsigned long int uc_flags; | |
87 | + struct ucontext *uc_link; | |
88 | + stack_t uc_stack; | |
89 | + mcontext_t uc_mcontext; | |
90 | + __sigset_t uc_sigmask; | |
91 | +} ucontext_t; | |
92 | + | |
93 | +#endif /* sys/ucontext.h */ |
@@ -0,0 +1,71 @@ | ||
1 | +#ifndef __ASM_RX_USER_H__ | |
2 | +#define __ASM_RX_USER_H__ | |
3 | + | |
4 | +/* This file copy of linux-2.6.3x */ | |
5 | + | |
6 | +/* Core file format: The core file is written in such a way that gdb | |
7 | + can understand it and provide useful information to the user (under | |
8 | + linux we use the 'trad-core' bfd). There are quite a number of | |
9 | + obstacles to being able to view the contents of the floating point | |
10 | + registers, and until these are solved you will not be able to view the | |
11 | + contents of them. Actually, you can read in the core file and look at | |
12 | + the contents of the user struct to find out what the floating point | |
13 | + registers contain. | |
14 | + The actual file contents are as follows: | |
15 | + UPAGE: 1 page consisting of a user struct that tells gdb what is present | |
16 | + in the file. Directly after this is a copy of the task_struct, which | |
17 | + is currently not used by gdb, but it may come in useful at some point. | |
18 | + All of the registers are stored as part of the upage. The upage should | |
19 | + always be only one page. | |
20 | + DATA: The data area is stored. We use current->end_text to | |
21 | + current->brk to pick up all of the user variables, plus any memory | |
22 | + that may have been malloced. No attempt is made to determine if a page | |
23 | + is demand-zero or if a page is totally unused, we just cover the entire | |
24 | + range. All of the addresses are rounded in such a way that an integral | |
25 | + number of pages is written. | |
26 | + STACK: We need the stack information in order to get a meaningful | |
27 | + backtrace. We need to write the data from (esp) to | |
28 | + current->start_stack, so we round each of these off in order to be able | |
29 | + to write an integer number of pages. | |
30 | + The minimum core file size is 3 pages, or 12288 bytes. | |
31 | +*/ | |
32 | + | |
33 | +struct user_regs_struct { | |
34 | + long r[16]; | |
35 | + long usp; | |
36 | + long vec; | |
37 | + long pc; | |
38 | + long psw; | |
39 | +}; | |
40 | + | |
41 | + | |
42 | +/* When the kernel dumps core, it starts by dumping the user struct - | |
43 | + this will be used by gdb to figure out where the data and stack segments | |
44 | + are within the file, and what virtual addresses to use. */ | |
45 | +struct user{ | |
46 | +/* We start with the registers, to mimic the way that "memory" is returned | |
47 | + from the ptrace(3,...) function. */ | |
48 | + struct user_regs_struct regs; /* Where the registers are actually stored */ | |
49 | +/* ptrace does not yet supply these. Someday.... */ | |
50 | +/* The rest of this junk is to help gdb figure out what goes where */ | |
51 | + unsigned long int u_tsize; /* Text segment size (pages). */ | |
52 | + unsigned long int u_dsize; /* Data segment size (pages). */ | |
53 | + unsigned long int u_ssize; /* Stack segment size (pages). */ | |
54 | + unsigned long start_code; /* Starting virtual address of text. */ | |
55 | + unsigned long start_stack; /* Starting virtual address of stack area. | |
56 | + This is actually the bottom of the stack, | |
57 | + the top of the stack is always found in the | |
58 | + esp register. */ | |
59 | + long int signal; /* Signal that caused the core dump. */ | |
60 | + int reserved; /* No longer used */ | |
61 | + unsigned long u_ar0; /* Used by gdb to help find the values for */ | |
62 | + /* the registers. */ | |
63 | + unsigned long magic; /* To uniquely identify a core file */ | |
64 | + char u_comm[32]; /* User command that was responsible */ | |
65 | +}; | |
66 | +#define NBPG 4096 | |
67 | +#define UPAGES 1 | |
68 | +#define HOST_TEXT_START_ADDR (u.start_code) | |
69 | +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | |
70 | + | |
71 | +#endif |
@@ -0,0 +1,23 @@ | ||
1 | +#include <features.h> | |
2 | + | |
3 | +#include <asm/unistd.h> | |
4 | + | |
5 | + .text | |
6 | + .align 4 | |
7 | + .globl __vfork | |
8 | + .hidden __vfork | |
9 | + .type __vfork,@function | |
10 | + | |
11 | +__vfork: | |
12 | + mov.l [r0+],r2 | |
13 | + mov.l #__NR_vfork,r8 | |
14 | + int #0x08 | |
15 | + cmp #-4096,r1 | |
16 | + bc 1f /* errno < 0 && errno >=4096 */ | |
17 | + jmp r2 | |
18 | +1: mov.l r2,[-r0] | |
19 | + bra __syscall_error | |
20 | + | |
21 | +weak_alias(__vfork,vfork) | |
22 | +libc_hidden_weak(vfork) | |
23 | + .end |