Danny Milosavljevic
8348e80589
ARM: Fix sub____%r1,%r0 encoding.
...
* lib/arm-mes/arm.M1 (sub____%r1,%r0): Fix encoding.
2019-09-09 18:34:04 +02:00
Danny Milosavljevic
dd2a679fda
ARM: Remove OABI-only system call numbers.
...
* include/linux/arm/syscall.h (SYS_time): Delete definition.
2019-09-09 18:34:04 +02:00
Jan Nieuwenhuizen
4b40bdc0cb
ARM: Workarounds for running mescc.
...
* module/mescc.scm (mescc:main): Oops, handle -std=STANDARD.
* build-aux/build.sh.in (CFLAGS): Add -std=gnu99. Fixes compilation
with gcc-4.9.
* src/reader.c (reader_read_identifier_or_number): Ugly hack: exit at
EOF. Fixes running mescc.
2019-09-09 18:34:04 +02:00
Jan Nieuwenhuizen
35c746043f
ARM: Mes C Library: Compile fixes.
...
* lib/arm-mes-mescc/setjmp.c (setjmp): Do not use x86 registers.
* lib/arm-mes/arm.M1 (uxtb__%r1,%r1): New macro.
2019-09-09 18:34:04 +02:00
Danny Milosavljevic
58be0fd7e0
ARM: mescc: Handle command-line option "-marm".
...
* module/mescc/mescc.scm (arch-get): Handle command-line option "-marm".
2019-09-09 18:34:04 +02:00
Danny Milosavljevic
c37eee6b3d
ARM: Prevent setjmp/longjmp inlining.
...
* lib/arm-mes-gcc/setjmp.c (longjmp): Prevent inlining.
(setjmp): Prevent inlining.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
3767477f5a
ARM: Add case for ARM.
...
* lib/tests/scaffold/76-pointer-arithmetic.c (main): Add case for ARM.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
807afb7d69
ARM: Implement setjmp/longjmp, part 2.
...
Follow-up to 102ccc27f6e619ca7207b6360ac918342711613a.
* include/setjmp.h (__jmp_buf): Add case for ARM.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
fbe90fb293
ARM: Implement setjmp/longjmp.
...
* lib/arm-mes-gcc/setjmp.c (setjmp): Implement.
(longjmp): Implement.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
21bf8a0d92
ARM: Special-case "struct sigaction".
...
* include/signal.h (struct sigaction): Special-case for ARM.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
24299d80ff
ARM: Special-case O_DIRECTORY.
...
* include/fcntl.h (O_DIRECTORY): Special-case for ARM.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
1f6ff076b2
ARM: Fix test.
...
* lib/tests/scaffold/7k-for-each-elem.c: Fix test.
2019-09-09 18:34:03 +02:00
Danny Milosavljevic
53620890f4
ARM: Disable Thumb mode.
...
* build-aux/build.sh.in: Disable Thumb mode.
* build-aux/check.sh.in: Disable Thumb mode.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
44cfdd7e3c
ARM: Fix stat test.
...
* build-aux/test-c.sh: Increase test timeout to 20 s.
* lib/tests/io/90-stat.c: Add __arm__ case for stat structure.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
2363259435
ARM: Fix test.
...
* lib/tests/scaffold/85-sizeof.c: Fix test.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
f3a266b960
ARM: Fix comment.
...
Follow-up to ca5425bfc4cd0ca0fee5002220e4cd329643d8c5.
* lib/mes/div.c: Fix comment.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
cf0b648185
ARM: Provide __aeabi_* only for ARM.
...
Follow-up to 25b3ac2ba85d9833227f75f841503a6697aab45e.
* lib/mes/div.c (__aeabi_idivmod, __aeabi_idiv, __aeabi_uidivmod,
__aeabi_uidiv): Add guard for ARM.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
b963db8342
ARM: Remove unused struct uidiv_t.
...
Follow-up to 25b3ac2ba85d9833227f75f841503a6697aab45e.
* lib/mes/div.c (uidiv_t): Delete.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
9a84e94a0a
ARM: Return both the quotient and the remainder.
...
* lib/mes/div.c (__aeabi_idivmod): Use ldiv. Return both quotient and
remainder.
(__aeabi_uidivmod): Use __mesabi_uldiv. Return both quotient and remainder.
2019-09-09 18:34:02 +02:00
Danny Milosavljevic
899b613dbc
ARM: Handle sign when dividing integers using gcc.
...
* lib/mes/div.c (__aeabi_idivmod): Use ldiv.
(__aeabi_idiv): Use ldiv.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
9ac6d37849
ARM: Delete _sys_call6 from arm-mes-gcc port.
...
* lib/linux/arm-mes-gcc/syscall.c (_sys_call6): Delete procedure.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
13fbd909d7
ARM: Specify R7 as changed.
...
* lib/linux/arm-mes-gcc/mini.c (_exit): Specify R7 as changed.
* lib/linux/arm-mes-gcc/syscall.c (_sys_call, _sys_call1, _sys_call2,
_sys_call3, _sys_call4): Specify R7 as changed.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
e5f326040d
ARM: Fix system call handling in arm-mes-gcc.
...
* lib/linux/arm-mes-gcc/syscall.c (_sys_call, _sys_call1, _sys_call2,
_sys_call3, _sys_call4, _sys_call5, _sys_call6): Modify.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
25a0e13501
ARM: Fix environment setup.
...
* lib/linux/arm-mes-gcc/crt1.c (_start): Fix environment setup.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
149cc43baf
ARM: Clean up _start.
...
lib/linux/arm-mes-gcc/crt1.c (_start): Clean up the function.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
a1217d71c1
ARM: Use GCC-emitted frame pointer.
...
* lib/linux/arm-mes-gcc/crt1.c (_start): Use GCC-emitted frame pointer.
2019-09-09 18:34:01 +02:00
Danny Milosavljevic
5199db9d8e
ARM: Fix arm-mes-gcc _start.
...
* lib/linux/arm-mes-gcc/crt1.c: Fix arm-mes-gcc _start.
2019-09-09 18:34:00 +02:00
Jan Nieuwenhuizen
37149aa84d
porting: arm scaffold WIP
2019-09-09 18:34:00 +02:00
Danny Milosavljevic
b314c66b3b
ARM: Fix syscalls, part 2.
...
* include/linux/arm/syscall.h: Fix syscalls.
2019-09-09 18:34:00 +02:00
Danny Milosavljevic
01ca0678c1
ARM: Add macro "mov____$i32,%r7".
...
* lib/arm-mes/arm.M1: Add macro "mov____$i32,%r7".
2019-09-09 18:34:00 +02:00
Danny Milosavljevic
90c9fefeb4
ARM: Fix syscall numbers.
...
* lib/arm-mes/arm.M1: Fix syscall numbers.
2019-09-09 18:34:00 +02:00
Danny Milosavljevic
7788b9f263
ARM: Fix "bl" macro.
...
* lib/arm-mes/arm.M1: Fix "bl" macro.
2019-09-09 18:34:00 +02:00
Jan Nieuwenhuizen
89591a4c51
ARM: some build hacks REVERTME
2019-09-09 18:34:00 +02:00
Jan Nieuwenhuizen
d977d39abc
ARM: Mes C Library: Support gcc __aeabi.
...
* lib/mes/div.c (__aeabi_idivmod, __aeabi_idiv, __aeabi_uidivmod,
__aeabi_uidiv): New function.
2019-09-09 18:33:59 +02:00
Jan Nieuwenhuizen
282abce86f
ARM: Mes C Library: Add compile stub for time.
...
* lib/linux/time.c (time)[SYS_gettimeofday]: Implemnt using gettimeofday.
(time)[!SYS_time && !SYS_gettimeofday]: Compile stub.
2019-09-09 18:33:59 +02:00
Jan Nieuwenhuizen
bfe710d2a2
ARM: Mes C Library: Support gcc-sans-libc.
...
* lib/linux/arm-mes-gcc/crt1.c: New file.
* lib/linux/arm-mes-gcc/mini.c: New file.
* lib/linux/arm-mes-gcc/syscall.c: New file.
* lib/arm-mes-gcc/setjmp.c: New file.
2019-09-09 18:33:59 +02:00
Jan Nieuwenhuizen
92d60477c5
ARM: Mes C Library: Support abort.
...
* lib/stdlib/abort.c (abort): Support Arm.
* lib/arm-mes/arm.M1 (wfi): New macro.
2019-09-09 18:33:59 +02:00
Danny Milosavljevic
705be3f917
ARM: Fix instruction encoding for "add____$i8,%esp" in armv4:call-label.
...
* module/mescc/armv4/as.scm (armv4:call-label): Fix instruction encoding
for "add____$i8,%esp".
2019-09-09 18:33:59 +02:00
Danny Milosavljevic
07c907884b
ARM: Fix off-by-one error in "mov____%r0,0x32".
...
* lib/arm-mes/arm.M1: Fix off-by-one error in "mov____%r0,0x32".
2019-09-09 18:33:59 +02:00
Danny Milosavljevic
f29cb12ec4
ARM: Make the ELF headers and footers very similar to x86 again.
...
* lib/arm-mes/elf32-0header.hex2: Modify.
* lib/arm-mes/elf32-footer-single-main.hex2: Modify.
* lib/arm-mes/elf32-header.hex2: Modify.
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
a725537f72
ARM: Define LONG_MIN etc.
...
* include/stdint.h: Define LONG_MIN etc for ARM.
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
eda0d8dca5
When emitting a function, also emit an aligner first.
...
* module/mescc/M1.scm (info->M1): When emitting a function, also emit
an aligner first.
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
83e7c4cc9e
ARM: Delete r9-exposing macros.
...
* lib/arm-mes/arm.M1: Delete r9-exposing macros.
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
de9dd28743
ARM: Add macro "mov____%esp,%r0".
...
* lib/arm-mes/arm.M1: Add macro "mov____%esp,%r0".
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
f3a3df9e55
ARM: Assume that double and long double are 4 Byte for now (FIXME).
...
* module/mescc/armv4/info.scm (armv4:type-alist): Assume that double and
long double are 4 Byte for now (FIXME).
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
9283e077b3
ARM: Fix "jmp____*%r1".
...
* lib/arm-mes/arm.M1: Fix "jmp____*%r1".
2019-09-09 18:33:58 +02:00
Danny Milosavljevic
8f1d2473bc
ARM: Add macro "uxtb__%r1,%r1".
...
* lib/arm-mes/arm.M1: Add macro "uxtb__%r1,%r1".
2019-09-09 18:33:57 +02:00
Danny Milosavljevic
ba7338a466
ARM: Fix armv4:be?->r.
...
* module/mescc/armv4/as.scm (armv4:be?->r): Use "movhi__%r?,$i8".
2019-09-09 18:33:57 +02:00
Danny Milosavljevic
badae1c4c4
ARM: Fix byte-mem-add.
...
* lib/arm-mes/arm.M1: Add macro "ldrb___%r0,(%r1)".
* module/mescc/armv4/as.scm (armv4:r-byte-mem-add): Use it.
2019-09-09 18:33:57 +02:00
Danny Milosavljevic
eebcb57b36
ARM: Add macro "mov____0x32(%ebp),%r0".
...
* lib/arm-mes/arm.M1: Add macro "mov____0x32(%ebp),%r0".
2019-09-09 18:33:57 +02:00