hrev52952 adds 5 changesets to branch 'master'
old head: d7b8d76a7862f9716c34b927f2abfacafbdd07c8
new head: a7c23bb4a92806407b15fef56a5652326c3f8622
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=a7c23bb4a928+%5Ed7b8d76a7862
----------------------------------------------------------------------------
5f49c5585101: m68k: simplify a Jamfile.
I'm copypasting a lot from this, so I may as well clean it up while I'm
at it.
Change-Id: I9288c087abbf95475f980b5539f2fd19fad7f775
Reviewed-on: https://review.haiku-os.org/c/1136
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
c5769c4f6b17: Make -Wcast-align only a warning
On x86 and x86_64, this warning is never emitted because it is perfectly
fine to do unaligned access. On sparc, such accesses are not supported
by the hardware and will generate a SIGBUS. This must be caught by a
trap handler, and the unaligned access performed there, slowly, using
byte by byte access.
However, making this a Werror is annoying because it will trigger
everytime one casts a byte pointer to something larger, even when
alignment is actually preserved. So, removing all such warnings would be
nearly impossible (for example, just for the mergesort function, there
is a whole GSoC project for it at FreeBSD).
Keep it as a warning for now. The warning can be silenced by using
BytePointer, if desired. We should also investigate where the SIGBUS
trap is triggered a lot and consider improving the alignment of data
where possible.
Change-Id: I6b90025e8c6d69ef1ccda3c10eee270ccc1ebd29
Reviewed-on: https://review.haiku-os.org/c/1103
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
c1566b155554: sparc: more platform headers
Previous commit adding these was merged very quickly, so here's one
more...
Change-Id: I23c424db7631db1f0ec48e2d0ae47c8409ae6af2
Reviewed-on: https://review.haiku-os.org/c/1088
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
e6c9be767b06: sparc: interrupt management functions
Change-Id: Icc689cc0cc0075fbccdad23f77cfa53b1f32df3c
Reviewed-on: https://review.haiku-os.org/c/1107
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
a7c23bb4a928: kernel/arch/sparc: stubs to get the kernel to link
Add empty implementation of timer, elf, vm, debugger support, to let the
kernel link.
Also add the kernel linker script.
Change-Id: If0795fa6554aea3df1ee544c25cc4832634ffd78
Reviewed-on: https://review.haiku-os.org/c/1108
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
[ PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
43 files changed, 1659 insertions(+), 43 deletions(-)
build/jam/ArchitectureRules | 10 +-
headers/private/kernel/arch/sparc/arch_debug.h | 18 ++
headers/private/kernel/arch/sparc/arch_kernel.h | 40 ++---
.../kernel/arch/sparc/arch_thread_types.h | 1 +
headers/private/kernel/arch/sparc/types.h | 4 +-
headers/private/system/arch/sparc/arch_config.h | 12 ++
.../private/system/arch/sparc/arch_cpu_defs.h | 0
headers/private/system/arch/sparc/asm_defs.h | 20 +++
src/system/boot/arch/sparc/Jamfile | 33 ++++
src/system/kernel/arch/sparc/Jamfile | 23 +++
src/system/kernel/arch/sparc/arch_asm.S | 75 ++++++++
src/system/kernel/arch/sparc/arch_commpage.cpp | 29 ++++
src/system/kernel/arch/sparc/arch_cpu.cpp | 99 +++++++++++
src/system/kernel/arch/sparc/arch_debug.cpp | 106 ++++++++++++
.../kernel/arch/sparc/arch_debug_console.cpp | 95 +++++++++++
src/system/kernel/arch/sparc/arch_elf.cpp | 99 +++++++++++
src/system/kernel/arch/sparc/arch_int.cpp | 56 ++++++
src/system/kernel/arch/sparc/arch_platform.cpp | 27 +++
.../kernel/arch/sparc/arch_real_time_clock.cpp | 37 ++++
src/system/kernel/arch/sparc/arch_smp.cpp | 58 +++++++
.../kernel/arch/sparc/arch_system_info.cpp | 35 ++++
src/system/kernel/arch/sparc/arch_thread.cpp | 170 +++++++++++++++++++
src/system/kernel/arch/sparc/arch_timer.cpp | 40 +++++
.../kernel/arch/sparc/arch_user_debugger.cpp | 95 +++++++++++
src/system/kernel/arch/sparc/arch_vm.cpp | 122 +++++++++++++
.../arch/sparc/arch_vm_translation_map.cpp | 100 +++++++++++
src/system/kernel/debug/core_dump.cpp | 2 +
src/system/kernel/lib/arch/sparc/Jamfile | 27 +++
src/system/ldscripts/sparc/kernel.ld | 60 +++++++
src/system/libroot/os/arch/sparc/syscalls.inc | 33 ++++
src/system/libroot/posix/arch/m68k/Jamfile | 31 ++--
src/system/libroot/posix/arch/sparc/Jamfile | 26 +++
src/system/libroot/posix/arch/sparc/siglongjmp.S | 20 +++
src/system/libroot/posix/arch/sparc/sigsetjmp.S | 13 ++
.../posix/glibc/include/arch/sparc/bits/endian.h | 7 +
.../glibc/include/arch/sparc/bits/huge_val.h | 8 +
.../glibc/include/arch/sparc/bits/mathdef.h | 31 ++++
.../glibc/include/arch/sparc/bits/mathinline.h | 22 +++
.../posix/glibc/include/arch/sparc/bits/nan.h | 5 +
.../glibc/include/arch/sparc/bits/wordsize.h | 1 +
.../posix/glibc/include/arch/sparc/config.h | 0
.../posix/glibc/include/arch/sparc/math_ldbl.h | 4 +
.../posix/glibc/include/arch/sparc/stackinfo.h | 8 +
############################################################################
Commit: 5f49c558510167c7ec665dc28de34fbe49f0301d
URL: https://git.haiku-os.org/haiku/commit/?id=5f49c5585101
Author: PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date: Sun Feb 24 21:02:55 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Mar 3 20:56:20 2019 UTC
m68k: simplify a Jamfile.
I'm copypasting a lot from this, so I may as well clean it up while I'm
at it.
Change-Id: I9288c087abbf95475f980b5539f2fd19fad7f775
Reviewed-on: https://review.haiku-os.org/c/1136
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
----------------------------------------------------------------------------
diff --git a/src/system/libroot/posix/arch/m68k/Jamfile
b/src/system/libroot/posix/arch/m68k/Jamfile
index 20965bf5a1..be57b3af49 100644
--- a/src/system/libroot/posix/arch/m68k/Jamfile
+++ b/src/system/libroot/posix/arch/m68k/Jamfile
@@ -1,25 +1,20 @@
SubDir HAIKU_TOP src system libroot posix arch m68k ;
-local architectureObject ;
-for architectureObject in [ MultiArchSubDirSetup m68k ] {
- on $(architectureObject) {
- local architecture = $(TARGET_PACKAGING_ARCH) ;
+local architecture = $(TARGET_ARCH) ;
- UsePrivateSystemHeaders ;
+UsePrivateSystemHeaders ;
- local genericSources =
- setjmp_save_sigs.c
- longjmp_return.c
- ;
+local genericSources =
+ setjmp_save_sigs.c
+ longjmp_return.c
+;
- MergeObject <$(architecture)>posix_arch_$(TARGET_ARCH).o :
- sigsetjmp.S
- siglongjmp.S
+MergeObject <$(TARGET_ARCH)>posix_arch_$(TARGET_ARCH).o :
+ sigsetjmp.S
+ siglongjmp.S
- $(genericSources)
- ;
+ $(genericSources)
+;
- SEARCH on [ FGristFiles $(genericSources) ]
- = [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
- }
-}
+SEARCH on [ FGristFiles $(genericSources) ]
+ = [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
############################################################################
Commit: c5769c4f6b174b75e7c4b8a93650662c07b8dcfd
URL: https://git.haiku-os.org/haiku/commit/?id=c5769c4f6b17
Author: PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date: Sun Feb 24 08:36:55 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Mar 3 20:56:20 2019 UTC
Make -Wcast-align only a warning
On x86 and x86_64, this warning is never emitted because it is perfectly
fine to do unaligned access. On sparc, such accesses are not supported
by the hardware and will generate a SIGBUS. This must be caught by a
trap handler, and the unaligned access performed there, slowly, using
byte by byte access.
However, making this a Werror is annoying because it will trigger
everytime one casts a byte pointer to something larger, even when
alignment is actually preserved. So, removing all such warnings would be
nearly impossible (for example, just for the mergesort function, there
is a whole GSoC project for it at FreeBSD).
Keep it as a warning for now. The warning can be silenced by using
BytePointer, if desired. We should also investigate where the SIGBUS
trap is triggered a lot and consider improving the alignment of data
where possible.
Change-Id: I6b90025e8c6d69ef1ccda3c10eee270ccc1ebd29
Reviewed-on: https://review.haiku-os.org/c/1103
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
----------------------------------------------------------------------------
diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules
index ce36276b3c..31c3eb72c8 100644
--- a/build/jam/ArchitectureRules
+++ b/build/jam/ArchitectureRules
@@ -115,12 +115,14 @@ rule ArchitectureSetup architecture
# warning flags
HAIKU_WARNING_CCFLAGS_$(architecture) = -Wall
-Wno-multichar
- -Wpointer-arith -Wcast-align -Wsign-compare
- -Wmissing-prototypes ;
+ -Wpointer-arith -Wsign-compare
+ -Wmissing-prototypes
+ -Wcast-align -Wno-error=cast-align ;
HAIKU_WARNING_C++FLAGS_$(architecture) = -Wall
-Wno-multichar
- -Wpointer-arith -Wcast-align -Wsign-compare
- -Wno-ctor-dtor-privacy -Woverloaded-virtual ;
+ -Wpointer-arith -Wsign-compare
+ -Wno-ctor-dtor-privacy -Woverloaded-virtual
+ -Wcast-align -Wno-error=cast-align ;
# disable some Clang warnings that are not very useful
if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
############################################################################
Commit: c1566b15555492794967aae3be1c1783cba0314a
URL: https://git.haiku-os.org/haiku/commit/?id=c1566b155554
Author: PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date: Sat Feb 23 17:23:22 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Mar 3 20:56:20 2019 UTC
sparc: more platform headers
Previous commit adding these was merged very quickly, so here's one
more...
Change-Id: I23c424db7631db1f0ec48e2d0ae47c8409ae6af2
Reviewed-on: https://review.haiku-os.org/c/1088
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
----------------------------------------------------------------------------
diff --git a/headers/private/kernel/arch/sparc/arch_debug.h
b/headers/private/kernel/arch/sparc/arch_debug.h
index e69de29bb2..7a05f1e82e 100644
--- a/headers/private/kernel/arch/sparc/arch_debug.h
+++ b/headers/private/kernel/arch/sparc/arch_debug.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2010, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_SPARC_DEBUG_H
+#define _KERNEL_ARCH_SPARC_DEBUG_H
+
+
+#include <SupportDefs.h>
+
+
+struct arch_debug_registers {
+ // TODO
+ addr_t r1;
+};
+
+
+#endif // _KERNEL_ARCH_SPARC_DEBUG_H
diff --git a/headers/private/kernel/arch/sparc/arch_kernel.h
b/headers/private/kernel/arch/sparc/arch_kernel.h
index 25d49ae0d2..bf2838bf1d 100644
--- a/headers/private/kernel/arch/sparc/arch_kernel.h
+++ b/headers/private/kernel/arch/sparc/arch_kernel.h
@@ -8,27 +8,29 @@
#include <arch/cpu.h>
-// memory layout
-#define KERNEL_BASE 0x80000000
-#define KERNEL_SIZE 0x80000000
-#define KERNEL_TOP (KERNEL_BASE + (KERNEL_SIZE - 1))
+// Base of the kernel address space.
+// KERNEL_BASE is the base of the kernel address space. This differs from the
+// address where the kernel is loaded to: the kernel is loaded in the top 2GB
+// of the virtual address space as required by GCC's kernel code model. The
+// whole kernel address space is the top 512GB of the address space.
+#define KERNEL_BASE 0xffffff0000000000
+#define KERNEL_SIZE 0x10000000000
+#define KERNEL_TOP (KERNEL_BASE + (KERNEL_SIZE - 1))
+#define KERNEL_LOAD_BASE 0xffffffff80000000
-/*
-** User space layout is a little special:
-** The user space does not completely cover the space not covered by the
kernel.
-** This is accomplished by starting user space at 1Mb and running to 64kb
short of kernel space.
-** The lower 1Mb reserved spot makes it easy to find null pointer references
and guarantees a
-** region wont be placed there. The 64kb region assures a user space thread
cannot pass
-** a buffer into the kernel as part of a syscall that would cross into kernel
space.
-*/
-#define USER_BASE 0x100000
-#define USER_BASE_ANY USER_BASE
-#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
-#define USER_TOP (USER_BASE + (USER_SIZE - 1))
-#define KERNEL_USER_DATA_BASE 0x60000000
-#define USER_STACK_REGION 0x70000000
-#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
+// Userspace address space layout.
+// There is a 2MB hole just before the end of the bottom half of the address
+// space. This means that if userland passes in a buffer that crosses into the
+// uncanonical address region, it will be caught through a page fault.
+#define USER_BASE 0x100000
+#define USER_BASE_ANY USER_BASE
+#define USER_SIZE (0x800000000000 - (0x200000 +
0x100000))
+#define USER_TOP (USER_BASE + (USER_SIZE - 1))
+
+#define KERNEL_USER_DATA_BASE 0x7f0000000000
+#define USER_STACK_REGION 0x7f0000000000
+#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
#endif /* _KERNEL_ARCH_SPARC_KERNEL_H */
diff --git a/headers/private/system/arch/sparc/arch_config.h
b/headers/private/system/arch/sparc/arch_config.h
index e69de29bb2..3cdb67ea26 100644
--- a/headers/private/system/arch/sparc/arch_config.h
+++ b/headers/private/system/arch/sparc/arch_config.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2019 Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_SPARC_CONFIG_H
+#define _KERNEL_ARCH_SPARC_CONFIG_H
+
+
+#define STACK_GROWS_DOWNWARDS
+
+
+#endif /* _KERNEL_ARCH_SPARC_CONFIG_H */
diff --git a/headers/private/system/arch/sparc/arch_cpu_defs.h
b/headers/private/system/arch/sparc/arch_cpu_defs.h
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/system/kernel/debug/core_dump.cpp
b/src/system/kernel/debug/core_dump.cpp
index 664d6cba9f..6ea28d38ce 100644
--- a/src/system/kernel/debug/core_dump.cpp
+++ b/src/system/kernel/debug/core_dump.cpp
@@ -1125,6 +1125,8 @@ private:
header.e_machine = EM_MIPS;
#elif defined(__HAIKU_ARCH_ARM)
header.e_machine = EM_ARM;
+#elif defined(__HAIKU_ARCH_SPARC)
+ header.e_machine = EM_SPARCV9;
#else
# error Unsupported architecture!
#endif
diff --git a/src/system/libroot/os/arch/sparc/syscalls.inc
b/src/system/libroot/os/arch/sparc/syscalls.inc
new file mode 100644
index 0000000000..031585d2d7
--- /dev/null
+++ b/src/system/libroot/os/arch/sparc/syscalls.inc
@@ -0,0 +1,33 @@
+/*
+** Copyright 2001-2007, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the MIT License.
+*/
+
+/* TODO actuall syscalls? */
+#define _SYSCALL(name, n) \
+.globl name; \
+.type name,%function; \
+.align 4; \
+name:
+
+#define SYSCALL0(name, n) _SYSCALL(name, n)
+#define SYSCALL1(name, n) _SYSCALL(name, n)
+#define SYSCALL2(name, n) _SYSCALL(name, n)
+#define SYSCALL3(name, n) _SYSCALL(name, n)
+#define SYSCALL4(name, n) _SYSCALL(name, n)
+#define SYSCALL5(name, n) _SYSCALL(name, n)
+#define SYSCALL6(name, n) _SYSCALL(name, n)
+#define SYSCALL7(name, n) _SYSCALL(name, n)
+#define SYSCALL8(name, n) _SYSCALL(name, n)
+#define SYSCALL9(name, n) _SYSCALL(name, n)
+#define SYSCALL10(name, n) _SYSCALL(name, n)
+#define SYSCALL11(name, n) _SYSCALL(name, n)
+#define SYSCALL12(name, n) _SYSCALL(name, n)
+#define SYSCALL13(name, n) _SYSCALL(name, n)
+#define SYSCALL14(name, n) _SYSCALL(name, n)
+#define SYSCALL15(name, n) _SYSCALL(name, n)
+#define SYSCALL16(name, n) _SYSCALL(name, n)
+#define SYSCALL17(name, n) _SYSCALL(name, n)
+#define SYSCALL18(name, n) _SYSCALL(name, n)
+#define SYSCALL19(name, n) _SYSCALL(name, n)
+#define SYSCALL20(name, n) _SYSCALL(name, n)
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/bits/endian.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/endian.h
new file mode 100644
index 0000000000..a55de950f8
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/endian.h
@@ -0,0 +1,7 @@
+/* sparc is big-endian. */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/bits/huge_val.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/huge_val.h
new file mode 100644
index 0000000000..4870e3c4ff
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/huge_val.h
@@ -0,0 +1,8 @@
+#ifndef _MATH_H
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+#endif
+
+
+# define HUGE_VAL (__builtin_huge_val())
+# define HUGE_VALF (__builtin_huge_valf())
+# define HUGE_VALL (__builtin_huge_vall())
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathdef.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathdef.h
new file mode 100644
index 0000000000..13b271dec2
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathdef.h
@@ -0,0 +1,31 @@
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF 1
+
+typedef float float_t;
+typedef double double_t;
+
+/* The values returned by `ilogb' for 0 and NaN respectively. */
+# define FP_ILOGB0 (-2147483647)
+# define FP_ILOGBNAN (2147483647)
+
+# define INFINITY (__builtin_inff())
+
+/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
+ builtins are supported. */
+# if __FP_FAST_FMA
+# define FP_FAST_FMA 1
+# endif
+
+# if __FP_FAST_FMAF
+# define FP_FAST_FMAF 1
+# endif
+
+# if __FP_FAST_FMAL
+# define FP_FAST_FMAL 1
+# endif
+
+#endif /* ISO C99 */
diff --git
a/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathinline.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathinline.h
new file mode 100644
index 0000000000..b9b3f6efab
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/mathinline.h
@@ -0,0 +1,22 @@
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#define __NTH(fct) __attribute__ ((__nothrow__)) fct
+
+#ifndef __extern_always_inline
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE __extern_always_inline
+#endif
+
+#if defined __USE_ISOC99
+
+# define isgreater(x, y) __builtin_isgreater (x, y)
+# define isgreaterequal(x, y) __builtin_isgreaterequal (x, y)
+# define isless(x, y) __builtin_isless (x, y)
+# define islessequal(x, y) __builtin_islessequal (x, y)
+# define islessgreater(x, y) __builtin_islessgreater (x, y)
+# define isunordered(x, y) __builtin_isunordered (x, y)
+
+#endif
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/bits/nan.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/nan.h
new file mode 100644
index 0000000000..c17012bcaa
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/nan.h
@@ -0,0 +1,5 @@
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+# define NAN (__builtin_nanf (""))
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/bits/wordsize.h
b/src/system/libroot/posix/glibc/include/arch/sparc/bits/wordsize.h
new file mode 100644
index 0000000000..2778a0e3fc
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/bits/wordsize.h
@@ -0,0 +1 @@
+# define __WORDSIZE 64
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/config.h
b/src/system/libroot/posix/glibc/include/arch/sparc/config.h
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/math_ldbl.h
b/src/system/libroot/posix/glibc/include/arch/sparc/math_ldbl.h
new file mode 100644
index 0000000000..1cd9d6752d
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/math_ldbl.h
@@ -0,0 +1,4 @@
+#ifndef _MATH_PRIVATE_H_
+#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
+#endif
+
diff --git a/src/system/libroot/posix/glibc/include/arch/sparc/stackinfo.h
b/src/system/libroot/posix/glibc/include/arch/sparc/stackinfo.h
new file mode 100644
index 0000000000..265063f96b
--- /dev/null
+++ b/src/system/libroot/posix/glibc/include/arch/sparc/stackinfo.h
@@ -0,0 +1,8 @@
+#ifndef _STACKINFO_H
+#define _STACKINFO_H 1
+
+/* On sparc the stack grows down. */
+#define _STACK_GROWS_DOWN 1
+
+#endif /* stackinfo.h */
+
############################################################################
Commit: e6c9be767b06a05e9bf7dca9bbf4175ee2487ad7
URL: https://git.haiku-os.org/haiku/commit/?id=e6c9be767b06
Author: PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date: Sun Feb 24 13:19:32 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Mar 3 20:56:20 2019 UTC
sparc: interrupt management functions
Change-Id: Icc689cc0cc0075fbccdad23f77cfa53b1f32df3c
Reviewed-on: https://review.haiku-os.org/c/1107
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
----------------------------------------------------------------------------
diff --git a/src/system/kernel/arch/sparc/arch_asm.S
b/src/system/kernel/arch/sparc/arch_asm.S
new file mode 100644
index 0000000000..25eef0aafc
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_asm.S
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <asm_defs.h>
+
+
+.text
+
+
+/* void arch_int_enable_interrupts(void) */
+FUNCTION(arch_int_enable_interrupts):
+ rdpr %pstate, %o0
+ or %o0, 2, %o0
+ wrpr %o0, 0, %pstate
+ ret
+FUNCTION_END(arch_int_enable_interrupts)
+
+
+/* int arch_int_disable_interrupts(void)
+ */
+FUNCTION(arch_int_disable_interrupts):
+ rdpr %pstate, %o1
+ // Set output register to previous state
+ and %o1, 2, %o0
+ // Clear interrupt bit
+ andn %o1, 2, %o1
+
+ wrpr %o1, 0, %pstate
+ ret
+FUNCTION_END(arch_int_disable_interrupts)
+
+
+/* void arch_int_restore_interrupts(int oldState)
+ */
+FUNCTION(arch_int_restore_interrupts):
+ rdpr %pstate, %o1
+ // Clear interrupt bit
+ andn %o1, 2, %o1
+ // Restore previous interript bit state
+ or %o1, %o0, %o1
+ wrpr %o1, 0, %pstate
+ ret
+FUNCTION_END(arch_int_restore_interrupts)
+
+
+/* bool arch_int_are_interrupts_enabled(void) */
+FUNCTION(arch_int_are_interrupts_enabled):
+ rdpr %pstate, %o0
+ andn %o0, 2, %o0
+ ret
+FUNCTION_END(arch_int_are_interrupts_enabled)
+
+
+/* status_t arch_cpu_user_memcpy(void *to, const void *from, size_t size,
addr_t *faultHandler) */
+FUNCTION(_arch_cpu_user_memcpy):
+ // TODO
+ ret
+FUNCTION_END(_arch_cpu_user_memcpy)
+
+
+/* status_t arch_cpu_user_memset(void *to, char c, size_t count, addr_t
*faultHandler) */
+FUNCTION(_arch_cpu_user_memset):
+ // TODO
+ ret
+FUNCTION_END(_arch_cpu_user_memset)
+
+
+/* ssize_t arch_cpu_user_strlcpy(void *to, const void *from, size_t size,
addr_t *faultHandler) */
+FUNCTION(_arch_cpu_user_strlcpy):
+ // TODO
+ ret
+FUNCTION_END(_arch_cpu_user_strlcpy)
############################################################################
Revision: hrev52952
Commit: a7c23bb4a92806407b15fef56a5652326c3f8622
URL: https://git.haiku-os.org/haiku/commit/?id=a7c23bb4a928
Author: PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date: Sun Feb 24 13:20:56 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Mar 3 20:56:20 2019 UTC
kernel/arch/sparc: stubs to get the kernel to link
Add empty implementation of timer, elf, vm, debugger support, to let the
kernel link.
Also add the kernel linker script.
Change-Id: If0795fa6554aea3df1ee544c25cc4832634ffd78
Reviewed-on: https://review.haiku-os.org/c/1108
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
----------------------------------------------------------------------------
diff --git a/headers/private/kernel/arch/sparc/arch_thread_types.h
b/headers/private/kernel/arch/sparc/arch_thread_types.h
index c3bb584291..dae90803d2 100644
--- a/headers/private/kernel/arch/sparc/arch_thread_types.h
+++ b/headers/private/kernel/arch/sparc/arch_thread_types.h
@@ -8,6 +8,7 @@
#include <arch_cpu.h>
+#include <kernel.h>
#define IFRAME_TRACE_DEPTH 4
diff --git a/headers/private/kernel/arch/sparc/types.h
b/headers/private/kernel/arch/sparc/types.h
index 0277bdd368..52764846f9 100644
--- a/headers/private/kernel/arch/sparc/types.h
+++ b/headers/private/kernel/arch/sparc/types.h
@@ -2,8 +2,8 @@
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
-#ifndef _ALPHA_TYPES_H
-#define _ALPHA_TYPES_H
+#ifndef _SPARC_TYPES_H
+#define _SPARC_TYPES_H
typedef unsigned long uint64;
typedef long int64;
diff --git a/headers/private/system/arch/sparc/asm_defs.h
b/headers/private/system/arch/sparc/asm_defs.h
new file mode 100644
index 0000000000..7f2b542153
--- /dev/null
+++ b/headers/private/system/arch/sparc/asm_defs.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2008, François Revol, revol@xxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef SYSTEM_ARCH_SPARC_ASM_DEFS_H
+#define SYSTEM_ARCH_SPARC_ASM_DEFS_H
+
+
+/* include arch version helpers */
+//#include <arch_sparc_version.h>
+
+#define SYMBOL(name) .global name; name
+#define SYMBOL_END(name) 1: .size name, 1b - name
+#define STATIC_FUNCTION(name) .type name, %function; name
+#define FUNCTION(name) .global name; .type name, %function;
name
+#define FUNCTION_END(name) 1: .size name, 1b - name
+
+#endif /* SYSTEM_ARCH_SPARC_ASM_DEFS_H */
+
+
diff --git a/src/system/boot/arch/sparc/Jamfile
b/src/system/boot/arch/sparc/Jamfile
new file mode 100644
index 0000000000..0ff3a31120
--- /dev/null
+++ b/src/system/boot/arch/sparc/Jamfile
@@ -0,0 +1,33 @@
+SubDir HAIKU_TOP src system boot arch sparc ;
+
+{
+ local defines = _BOOT_MODE ;
+
+ defines = [ FDefines $(defines) ] ;
+ SubDirCcFlags $(defines) ;
+ SubDirC++Flags $(defines) -fno-rtti ;
+}
+
+
+local kernelLibArchObjects =
+ <src!system!kernel!lib!arch!$(TARGET_ARCH)>byteorder.o
+ <src!system!kernel!lib!arch!$(TARGET_ARCH)>memcpy.o
+ <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
+;
+
+BootMergeObject boot_arch_$(TARGET_KERNEL_ARCH).o :
+ debug_uart_8250.cpp
+ #arch_uart_8250.cpp
+ arch_elf.cpp
+ : # additional flags
+ :
+ $(kernelArchObjects)
+ $(kernelLibArchObjects)
+;
+
+SEARCH on [ FGristFiles arch_elf.cpp arch_uart_8250.cpp ]
+ = [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
+
+SEARCH on [ FGristFiles debug_uart_8250.cpp ]
+ = [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;
+
diff --git a/src/system/kernel/arch/sparc/Jamfile
b/src/system/kernel/arch/sparc/Jamfile
new file mode 100644
index 0000000000..f98db03143
--- /dev/null
+++ b/src/system/kernel/arch/sparc/Jamfile
@@ -0,0 +1,23 @@
+SubDir HAIKU_TOP src system kernel arch sparc ;
+
+KernelMergeObject kernel_arch_sparc.o :
+ arch_asm.S
+ arch_commpage.cpp
+ arch_cpu.cpp
+ arch_debug.cpp
+ arch_debug_console.cpp
+ arch_elf.cpp
+ arch_int.cpp
+ arch_platform.cpp
+ arch_real_time_clock.cpp
+ arch_smp.cpp
+ arch_system_info.cpp
+ arch_timer.cpp
+ arch_thread.cpp
+ arch_user_debugger.cpp
+ arch_vm.cpp
+ arch_vm_translation_map.cpp
+ :
+ $(TARGET_KERNEL_PIC_CCFLAGS) -Wno-unused
+ :
+;
diff --git a/src/system/kernel/arch/sparc/arch_commpage.cpp
b/src/system/kernel/arch/sparc/arch_commpage.cpp
new file mode 100644
index 0000000000..b7378611ab
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_commpage.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2007, Travis Geiselbrecht. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+
+#include <commpage.h>
+
+#include <string.h>
+
+#include <KernelExport.h>
+
+#include <cpu.h>
+#include <elf.h>
+#include <smp.h>
+
+
+status_t
+arch_commpage_init(void)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_commpage_init_post_cpus(void)
+{
+ return B_OK;
+}
+
diff --git a/src/system/kernel/arch/sparc/arch_cpu.cpp
b/src/system/kernel/arch/sparc/arch_cpu.cpp
new file mode 100644
index 0000000000..c8fa731a13
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_cpu.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <KernelExport.h>
+
+#include <arch/cpu.h>
+#include <boot/kernel_args.h>
+#include <commpage.h>
+#include <elf.h>
+
+
+status_t
+arch_cpu_preboot_init_percpu(kernel_args *args, int curr_cpu)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_cpu_init_percpu(kernel_args *args, int curr_cpu)
+{
+ //detect_cpu(curr_cpu);
+
+ // we only support one anyway...
+ return 0;
+}
+
+
+status_t
+arch_cpu_init(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_cpu_init_post_vm(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_cpu_init_post_modules(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+void
+arch_cpu_sync_icache(void *address, size_t len)
+{
+}
+
+
+void
+arch_cpu_memory_read_barrier(void)
+{
+}
+
+
+void
+arch_cpu_memory_write_barrier(void)
+{
+}
+
+
+void
+arch_cpu_invalidate_TLB_range(addr_t start, addr_t end)
+{
+}
+
+
+void
+arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages)
+{
+}
+
+
+void
+arch_cpu_global_TLB_invalidate(void)
+{
+}
+
+
+void
+arch_cpu_user_TLB_invalidate(void)
+{
+}
+
+
+status_t
+arch_cpu_shutdown(bool reboot)
+{
+ return B_ERROR;
+}
diff --git a/src/system/kernel/arch/sparc/arch_debug.cpp
b/src/system/kernel/arch/sparc/arch_debug.cpp
new file mode 100644
index 0000000000..495c9abf0e
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_debug.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2019, Haiku, Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
+ */
+
+
+#include <arch/debug.h>
+
+
+void
+arch_debug_stack_trace(void)
+{
+}
+
+
+bool
+arch_debug_contains_call(Thread *thread, const char *symbol,
+ addr_t start, addr_t end)
+{
+ return false;
+}
+
+
+void *
+arch_debug_get_caller(void)
+{
+ return NULL;
+}
+
+
+void
+arch_debug_save_registers(struct arch_debug_registers* registers)
+{
+}
+
+
+void
+arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer,
+ void (*function)(void*), void* parameter)
+{
+}
+
+
+bool
+arch_is_debug_variable_defined(const char* variableName)
+{
+ // TODO: Implement!
+ return false;
+}
+
+
+status_t
+arch_set_debug_variable(const char* variableName, uint64 value)
+{
+ // TODO: Implement!
+ return B_ENTRY_NOT_FOUND;
+}
+
+
+status_t
+arch_get_debug_variable(const char* variableName, uint64* value)
+{
+ // TODO: Implement!
+ return B_ENTRY_NOT_FOUND;
+}
+
+
+int32
+arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
+ int32 skipIframes, int32 skipFrames, uint32 flags)
+{
+ return 0;
+}
+
+
+ssize_t
+arch_debug_gdb_get_registers(char* buffer, size_t bufferSize)
+{
+ // TODO: Implement!
+ return B_NOT_SUPPORTED;
+}
+
+
+void*
+arch_debug_get_interrupt_pc(bool* _isSyscall)
+{
+ // TODO: Implement!
+ return NULL;
+}
+
+
+status_t
+arch_debug_init(kernel_args *args)
+{
+#if 0
+ add_debugger_command("where", &stack_trace, "Same as \"sc\"");
+ add_debugger_command("bt", &stack_trace, "Same as \"sc\" (as in gdb)");
+ add_debugger_command("sc", &stack_trace, "Stack crawl for current
thread");
+#endif
+
+ return B_NO_ERROR;
+}
+
diff --git a/src/system/kernel/arch/sparc/arch_debug_console.cpp
b/src/system/kernel/arch/sparc/arch_debug_console.cpp
new file mode 100644
index 0000000000..32eaa295fe
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_debug_console.cpp
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2003-2006, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ *
+ * Copyright 2001, Travis Geiselbrecht. All rights reserved.
+ * Distributed under the terms of the NewOS License.
+ */
+
+
+#include <arch/debug_console.h>
+#include <boot/kernel_args.h>
+#include <kernel.h>
+#include <vm/vm.h>
+
+#include <string.h>
+
+
+void
+arch_debug_remove_interrupt_handler(uint32 line)
+{
+}
+
+
+void
+arch_debug_install_interrupt_handlers(void)
+{
+}
+
+
+int
+arch_debug_blue_screen_try_getchar(void)
+{
+ return 0;
+}
+
+
+char
+arch_debug_blue_screen_getchar(void)
+{
+ return 0;
+}
+
+
+int
+arch_debug_serial_try_getchar(void)
+{
+ // TODO: Implement correctly!
+ return arch_debug_serial_getchar();
+}
+
+
+char
+arch_debug_serial_getchar(void)
+{
+ return 0;
+}
+
+
+void
+arch_debug_serial_putchar(const char c)
+{
+}
+
+
+void
+arch_debug_serial_puts(const char *s)
+{
+ while (*s != '\0') {
+ arch_debug_serial_putchar(*s);
+ s++;
+ }
+}
+
+
+void
+arch_debug_serial_early_boot_message(const char *string)
+{
+ // this function will only be called in fatal situations
+}
+
+
+status_t
+arch_debug_console_init(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_debug_console_init_settings(kernel_args *args)
+{
+ return B_OK;
+}
+
+
diff --git a/src/system/kernel/arch/sparc/arch_elf.cpp
b/src/system/kernel/arch/sparc/arch_elf.cpp
new file mode 100644
index 0000000000..452f9d80fe
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_elf.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2019, Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
+ * Copyright 2010, Ithamar R. Adema <ithamar.adema@xxxxxxxxxxxxxxxx>
+ * Copyright 2009, Johannes Wischert, johanneswi@xxxxxxxxx.
+ * Copyright 2005, Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>.
+ * Copyright 2002, Travis Geiselbrecht. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <KernelExport.h>
+
+#include <elf_priv.h>
+#include <arch/elf.h>
+
+
+//#define TRACE_ARCH_ELF
+#ifdef TRACE_ARCH_ELF
+# define TRACE(x) dprintf x
+# define CHATTY 1
+#else
+# define TRACE(x) ;
+# define CHATTY 0
+#endif
+
+
+#ifndef _BOOT_MODE
+static bool
+is_in_image(struct elf_image_info *image, addr_t address)
+{
+ return (address >= image->text_region.start
+ && address < image->text_region.start +
image->text_region.size)
+ || (address >= image->data_region.start
+ && address < image->data_region.start +
image->data_region.size);
+}
+#endif // !_BOOT_MODE
+
+
+int
+arch_elf_relocate_rel(struct elf_image_info *image,
+ struct elf_image_info *resolve_image, Elf64_Rel *rel, int rel_len)
+{
+ // there are no rel entries in M68K elf
+ return B_NO_ERROR;
+}
+
+
+static inline void
+write_32(addr_t P, Elf32_Word value)
+{
+ *(Elf32_Word*)P = value;
+}
+
+
+static inline void
+write_16(addr_t P, Elf32_Word value)
+{
+ // bits 16:29
+ *(Elf32_Half*)P = (Elf32_Half)value;
+}
+
+
+static inline bool
+write_16_check(addr_t P, Elf32_Word value)
+{
+ // bits 15:0
+ if ((value & 0xffff0000) && (~value & 0xffff8000))
+ return false;
+ *(Elf32_Half*)P = (Elf32_Half)value;
+ return true;
+}
+
+
+static inline bool
+write_8(addr_t P, Elf32_Word value)
+{
+ // bits 7:0
+ *(uint8 *)P = (uint8)value;
+ return true;
+}
+
+
+static inline bool
+write_8_check(addr_t P, Elf32_Word value)
+{
+ // bits 7:0
+ if ((value & 0xffffff00) && (~value & 0xffffff80))
+ return false;
+ *(uint8 *)P = (uint8)value;
+ return true;
+}
+
+
+int
+arch_elf_relocate_rela(struct elf_image_info *image,
+ struct elf_image_info *resolve_image, Elf64_Rela *rel, int rel_len)
+{
+ return B_OK;
+}
diff --git a/src/system/kernel/arch/sparc/arch_int.cpp
b/src/system/kernel/arch/sparc/arch_int.cpp
new file mode 100644
index 0000000000..885044d2aa
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_int.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2003-2011, Haiku, Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ */
+
+
+#include <int.h>
+
+
+status_t
+arch_int_init(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_int_init_post_vm(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_int_init_post_device_manager(struct kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_int_init_io(kernel_args* args)
+{
+ return B_OK;
+}
+
+
+void
+arch_int_enable_io_interrupt(int irq)
+{
+}
+
+
+void
+arch_int_disable_io_interrupt(int irq)
+{
+}
+
+
+void
+arch_int_assign_to_cpu(int32 irq, int32 cpu)
+{
+}
diff --git a/src/system/kernel/arch/sparc/arch_platform.cpp
b/src/system/kernel/arch/sparc/arch_platform.cpp
new file mode 100644
index 0000000000..30a2394057
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_platform.cpp
@@ -0,0 +1,27 @@
+/* Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <arch/platform.h>
+
+
+status_t
+arch_platform_init(struct kernel_args *kernelArgs)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_platform_init_post_vm(struct kernel_args *kernelArgs)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_platform_init_post_thread(struct kernel_args *kernelArgs)
+{
+ return B_OK;
+}
diff --git a/src/system/kernel/arch/sparc/arch_real_time_clock.cpp
b/src/system/kernel/arch/sparc/arch_real_time_clock.cpp
new file mode 100644
index 0000000000..937b58d595
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_real_time_clock.cpp
@@ -0,0 +1,37 @@
+#include <arch/real_time_clock.h>
+
+#include <real_time_clock.h>
+#include <real_time_data.h>
+
+
+status_t
+arch_rtc_init(kernel_args *args, struct real_time_data *data)
+{
+ return B_OK;
+}
+
+
+uint32
+arch_rtc_get_hw_time(void)
+{
+ return 0;
+}
+
+
+void
+arch_rtc_set_hw_time(uint32 seconds)
+{
+}
+
+
+void
+arch_rtc_set_system_time_offset(struct real_time_data *data, bigtime_t offset)
+{
+}
+
+
+bigtime_t
+arch_rtc_get_system_time_offset(struct real_time_data *data)
+{
+ return 0;
+}
diff --git a/src/system/kernel/arch/sparc/arch_smp.cpp
b/src/system/kernel/arch/sparc/arch_smp.cpp
new file mode 100644
index 0000000000..5971139e11
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_smp.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2007, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * François Revol <revol@xxxxxxx>
+ *
+ * Copyright 2004, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <KernelExport.h>
+
+#include <boot/stage2.h>
+#include <arch/smp.h>
+#include <debug.h>
+#include <int.h>
+
+
+status_t
+arch_smp_init(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_smp_per_cpu_init(kernel_args *args, int32 cpu)
+{
+ return B_OK;
+}
+
+
+void
+arch_smp_send_multicast_ici(CPUSet& cpuSet)
+{
+#if KDEBUG
+ if (are_interrupts_enabled())
+ panic("arch_smp_send_multicast_ici: called with interrupts
enabled");
+#endif
+}
+
+
+void
+arch_smp_send_ici(int32 target_cpu)
+{
+ panic("called arch_smp_send_ici!\n");
+}
+
+
+void
+arch_smp_send_broadcast_ici()
+{
+ panic("called arch_smp_send_broadcast_ici\n");
+}
+
+
diff --git a/src/system/kernel/arch/sparc/arch_system_info.cpp
b/src/system/kernel/arch/sparc/arch_system_info.cpp
new file mode 100644
index 0000000000..97905d62e9
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_system_info.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2007, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * François Revol <revol@xxxxxxx>
+ *
+ * Copyright 2006, Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>.
+ * All rights reserved. Distributed under the terms of the MIT License.
+ */
+
+#include <OS.h>
+
+#include <arch_cpu.h>
+#include <arch/system_info.h>
+#include <boot/kernel_args.h>
+
+
+static uint64 sCPUClockFrequency;
+static uint64 sBusClockFrequency;
+static uint16 sCPURevision;
+
+
+void
+arch_fill_topology_node(cpu_topology_node_info* node, int32 cpu)
+{
+}
+
+
+status_t
+arch_system_info_init(struct kernel_args *args)
+{
+ return B_OK;
+}
+
diff --git a/src/system/kernel/arch/sparc/arch_thread.cpp
b/src/system/kernel/arch/sparc/arch_thread.cpp
new file mode 100644
index 0000000000..2cc0009bfe
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_thread.cpp
@@ -0,0 +1,170 @@
+/* Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <string.h>
+
+#include <arch_cpu.h>
+#include <arch/thread.h>
+#include <boot/stage2.h>
+#include <kernel.h>
+#include <thread.h>
+#include <vm/vm_types.h>
+
+
+status_t
+arch_thread_init(struct kernel_args *args)
+{
+ // Initialize the static initial arch_thread state (sInitialState).
+ // Currently nothing to do, i.e. zero initialized is just fine.
+
+ return B_OK;
+}
+
+
+status_t
+arch_team_init_team_struct(Team *team, bool kernel)
+{
+ // Nothing to do. The structure is empty.
+ return B_OK;
+}
+
+
+status_t
+arch_thread_init_thread_struct(Thread *thread)
+{
+ // set up an initial state (stack & fpu)
+ //memcpy(&thread->arch_info, &sInitialState, sizeof(struct
arch_thread));
+
+ return B_OK;
+}
+
+
+void
+arch_thread_init_kthread_stack(Thread* thread, void* _stack, void* _stackTop,
+ void (*function)(void*), const void* data)
+{
+#if 0
+ addr_t *kstack = (addr_t *)t->kernel_stack_base;
+ addr_t *kstackTop = (addr_t *)t->kernel_stack_base;
+
+ // clear the kernel stack
+#ifdef DEBUG_KERNEL_STACKS
+# ifdef STACK_GROWS_DOWNWARDS
+ memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES *
B_PAGE_SIZE), 0,
+ KERNEL_STACK_SIZE);
+# else
+ memset(kstack, 0, KERNEL_STACK_SIZE);
+# endif
+#else
+ memset(kstack, 0, KERNEL_STACK_SIZE);
+#endif
+
+ // space for frame pointer and return address, and stack frames must be
+ // 16 byte aligned
+ kstackTop -= 2;
+ kstackTop = (addr_t*)((addr_t)kstackTop & ~0xf);
+
+ // LR, CR, r2, r13-r31, f13-f31, as pushed by m68k_context_switch()
+ kstackTop -= 22 + 2 * 19;
+
+ // let LR point to m68k_kernel_thread_root()
+ kstackTop[0] = (addr_t)&m68k_kernel_thread_root;
+
+ // the arguments of m68k_kernel_thread_root() are the functions to call,
+ // provided in registers r13-r15
+ kstackTop[3] = (addr_t)entry_func;
+ kstackTop[4] = (addr_t)start_func;
+ kstackTop[5] = (addr_t)exit_func;
+
+ // save this stack position
+ t->arch_info.sp = (void *)kstackTop;
+
+ return B_OK;
+#else
+ panic("arch_thread_init_kthread_stack(): Implement me!");
+#endif
+}
+
+
+status_t
+arch_thread_init_tls(Thread *thread)
+{
+ // TODO: Implement!
+ return B_OK;
+}
+
+
+void
+arch_thread_context_switch(Thread *from, Thread *to)
+{
+}
+
+
+void
+arch_thread_dump_info(void *info)
+{
+}
+
+
+status_t
+arch_thread_enter_userspace(Thread *thread, addr_t entry, void *arg1, void
*arg2)
+{
+ panic("arch_thread_enter_uspace(): not yet implemented\n");
+ return B_ERROR;
+}
+
+
+bool
+arch_on_signal_stack(Thread *thread)
+{
+ return false;
+}
+
+
+status_t
+arch_setup_signal_frame(Thread *thread, struct sigaction *sa,
+ struct signal_frame_data *signalFrameData)
+{
+ return B_ERROR;
+}
+
+
+int64
+arch_restore_signal_frame(struct signal_frame_data* signalFrameData)
+{
+ return 0;
+}
+
+
+void
+arch_check_syscall_restart(Thread *thread)
+{
+}
+
+
+/** Saves everything needed to restore the frame in the child fork in the
+ * arch_fork_arg structure to be passed to arch_restore_fork_frame().
+ * Also makes sure to return the right value.
+ */
+
+void
+arch_store_fork_frame(struct arch_fork_arg *arg)
+{
+}
+
+
+/** Restores the frame from a forked team as specified by the provided
+ * arch_fork_arg structure.
+ * Needs to be called from within the child team, ie. instead of
+ * arch_thread_enter_uspace() as thread "starter".
+ * This function does not return to the caller, but will enter userland
+ * in the child team at the same position where the parent team left of.
+ */
+
+void
+arch_restore_fork_frame(struct arch_fork_arg *arg)
+{
+}
+
diff --git a/src/system/kernel/arch/sparc/arch_timer.cpp
b/src/system/kernel/arch/sparc/arch_timer.cpp
new file mode 100644
index 0000000000..edda9d3031
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_timer.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2019, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
+ */
+
+
+#include <kernel.h>
+#include <debug.h>
+#include <timer.h>
+#include <arch/timer.h>
+
+
+void
+arch_timer_set_hardware_timer(bigtime_t timeout)
+{
+}
+
+
+void
+arch_timer_clear_hardware_timer()
+{
+}
+
+
+int
+arch_init_timer(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+bigtime_t
+system_time(void)
+{
+ // TODO
+ return 0;
+}
diff --git a/src/system/kernel/arch/sparc/arch_user_debugger.cpp
b/src/system/kernel/arch/sparc/arch_user_debugger.cpp
new file mode 100644
index 0000000000..08023893e8
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_user_debugger.cpp
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <debugger.h>
+#include <int.h>
+#include <thread.h>
+#include <arch/user_debugger.h>
+
+
+void
+arch_clear_team_debug_info(struct arch_team_debug_info *info)
+{
+}
+
+
+void
+arch_destroy_team_debug_info(struct arch_team_debug_info *info)
+{
+ arch_clear_team_debug_info(info);
+}
+
+
+void
+arch_clear_thread_debug_info(struct arch_thread_debug_info *info)
+{
+}
+
+
+void
+arch_destroy_thread_debug_info(struct arch_thread_debug_info *info)
+{
+ arch_clear_thread_debug_info(info);
+}
+
+
+void
+arch_update_thread_single_step()
+{
+}
+
+
+void
+arch_set_debug_cpu_state(const debug_cpu_state *cpuState)
+{
+}
+
+
+void
+arch_get_debug_cpu_state(debug_cpu_state *cpuState)
+{
+}
+
+
+status_t
+arch_get_thread_debug_cpu_state(Thread* thread, debug_cpu_state* cpuState)
+{
+ return B_UNSUPPORTED;
+}
+
+
+status_t
+arch_set_breakpoint(void *address)
+{
+ return B_ERROR;
+}
+
+
+status_t
+arch_clear_breakpoint(void *address)
+{
+ return B_ERROR;
+}
+
+
+status_t
+arch_set_watchpoint(void *address, uint32 type, int32 length)
+{
+ return B_ERROR;
+}
+
+
+status_t
+arch_clear_watchpoint(void *address)
+{
+ return B_ERROR;
+}
+
+bool
+arch_has_breakpoints(struct arch_team_debug_info *info)
+{
+ return false;
+}
diff --git a/src/system/kernel/arch/sparc/arch_vm.cpp
b/src/system/kernel/arch/sparc/arch_vm.cpp
new file mode 100644
index 0000000000..5aa8636c06
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_vm.cpp
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2001, Travis Geiselbrecht. All rights reserved.
+ * Copyright 2003-2005, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx.
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+#include <vm/vm.h>
+#include <vm/VMAddressSpace.h>
+#include <arch/vm.h>
+
+
+//#define TRACE_ARCH_VM
+#ifdef TRACE_ARCH_VM
+# define TRACE(x) dprintf x
+#else
+# define TRACE(x) ;
+#endif
+
+
+status_t
+arch_vm_init(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_vm_init_post_area(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_vm_init_post_modules(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_vm_init_end(kernel_args *args)
+{
+ TRACE(("arch_vm_init_end(): %lu virtual ranges to keep:\n",
+ args->arch_args.num_virtual_ranges_to_keep));
+
+ for (int i = 0; i < (int)args->arch_args.num_virtual_ranges_to_keep;
i++) {
+ addr_range &range = args->arch_args.virtual_ranges_to_keep[i];
+
+ TRACE((" start: %p, size: 0x%lx\n", (void*)range.start,
range.size));
+
+#if 0
+ // skip ranges outside the kernel address space
+ if (!IS_KERNEL_ADDRESS(range.start)) {
+ TRACE((" no kernel address, skipping...\n"));
+ continue;
+ }
+
+ phys_addr_t physicalAddress;
+ void *address = (void*)range.start;
+ if (vm_get_page_mapping(VMAddressSpace::KernelID(), range.start,
+ &physicalAddress) != B_OK)
+ panic("arch_vm_init_end(): No page mapping for %p\n",
address);
+ area_id area =
vm_map_physical_memory(VMAddressSpace::KernelID(),
+ "boot loader reserved area", &address,
+ B_EXACT_ADDRESS, range.size,
+ B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
+ physicalAddress, true);
+ if (area < 0) {
+ panic("arch_vm_init_end(): Failed to create area for
boot loader "
+ "reserved area: %p - %p\n", (void*)range.start,
+ (void*)(range.start + range.size));
+ }
+#endif
+ }
+
+#if 0
+ // Throw away any address space mappings we've inherited from the boot
+ // loader and have not yet turned into an area.
+ vm_free_unused_boot_loader_range(0, 0xffffffff - B_PAGE_SIZE + 1);
+#endif
+
+ return B_OK;
+}
+
+
+void
+arch_vm_aspace_swap(struct VMAddressSpace *from, struct VMAddressSpace *to)
+{
+ // This functions is only invoked when a userland thread is in the
process
+ // of dying. It switches to the kernel team and does whatever cleanup is
+ // necessary (in case it is the team's main thread, it will delete the
+ // team).
+ // It is however not necessary to change the page directory. Userland
team's
+ // page directories include all kernel mappings as well. Furthermore our
+ // arch specific translation map data objects are ref-counted, so they
won't
+ // go away as long as they are still used on any CPU.
+}
+
+
+bool
+arch_vm_supports_protection(uint32 protection)
+{
+ return true;
+}
+
+
+void
+arch_vm_unset_memory_type(VMArea *area)
+{
+}
+
+
+status_t
+arch_vm_set_memory_type(VMArea *area, addr_t physicalBase, uint32 type)
+{
+ if (type == 0)
+ return B_OK;
+
+ return B_ERROR;
+}
diff --git a/src/system/kernel/arch/sparc/arch_vm_translation_map.cpp
b/src/system/kernel/arch/sparc/arch_vm_translation_map.cpp
new file mode 100644
index 0000000000..afb42677a2
--- /dev/null
+++ b/src/system/kernel/arch/sparc/arch_vm_translation_map.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2007-2010, François Revol, revol@xxxxxxx.
+ * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxx.
+ * Copyright 2002-2007, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. All rights
reserved.
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ *
+ * Copyright 2001, Travis Geiselbrecht. All rights reserved.
+ * Distributed under the terms of the NewOS License.
+ */
+
+
+#include <KernelExport.h>
+#include <kernel.h>
+#include <vm/vm.h>
+#include <vm/vm_priv.h>
+#include <vm/VMAddressSpace.h>
+
+
+#define TRACE_VM_TMAP
+#ifdef TRACE_VM_TMAP
+# define TRACE(x...) dprintf(x)
+#else
+# define TRACE(x...) ;
+#endif
+
+
+status_t
+arch_vm_translation_map_init(kernel_args *args,
+ VMPhysicalPageMapper** _physicalPageMapper)
+{
+ TRACE("vm_translation_map_init: entry\n");
+
+#ifdef TRACE_VM_TMAP
+ TRACE("physical memory ranges:\n");
+ for (uint32 i = 0; i < args->num_physical_memory_ranges; i++) {
+ phys_addr_t start = args->physical_memory_range[i].start;
+ phys_addr_t end = start + args->physical_memory_range[i].size;
+ TRACE(" %#10" B_PRIxPHYSADDR " - %#10" B_PRIxPHYSADDR "\n",
start,
+ end);
+ }
+
+ TRACE("allocated physical ranges:\n");
+ for (uint32 i = 0; i < args->num_physical_allocated_ranges; i++) {
+ phys_addr_t start = args->physical_allocated_range[i].start;
+ phys_addr_t end = start +
args->physical_allocated_range[i].size;
+ TRACE(" %#10" B_PRIxPHYSADDR " - %#10" B_PRIxPHYSADDR "\n",
start,
+ end);
+ }
+
+ TRACE("allocated virtual ranges:\n");
+ for (uint32 i = 0; i < args->num_virtual_allocated_ranges; i++) {
+ addr_t start = args->virtual_allocated_range[i].start;
+ addr_t end = start + args->virtual_allocated_range[i].size;
+ TRACE(" %#10" B_PRIxADDR " - %#10" B_PRIxADDR "\n", start,
end);
+ }
+#endif
+
+ return B_OK;
+}
+
+
+status_t
+arch_vm_translation_map_init_post_sem(kernel_args *args)
+{
+ return B_OK;
+}
+
+
+status_t
+arch_vm_translation_map_init_post_area(kernel_args *args)
+{
+ TRACE("vm_translation_map_init_post_area: entry\n");
+ return B_OK;
+}
+
+
+status_t
+arch_vm_translation_map_early_map(kernel_args *args, addr_t va, phys_addr_t pa,
+ uint8 attributes, phys_addr_t (*get_free_page)(kernel_args *))
+{
+ TRACE("early_tmap: entry pa 0x%lx va 0x%lx\n", pa, va);
+ return B_OK;
+}
+
+
+status_t
+arch_vm_translation_map_create_map(bool kernel, VMTranslationMap** _map)
+{
+ return B_OK;
+}
+
+
+bool
+arch_vm_translation_map_is_kernel_page_accessible(addr_t virtualAddress,
+ uint32 protection)
+{
+ return false;
+}
+
diff --git a/src/system/kernel/lib/arch/sparc/Jamfile
b/src/system/kernel/lib/arch/sparc/Jamfile
new file mode 100644
index 0000000000..93c51fa330
--- /dev/null
+++ b/src/system/kernel/lib/arch/sparc/Jamfile
@@ -0,0 +1,27 @@
+SubDir HAIKU_TOP src system kernel lib arch sparc ;
+
+SEARCH_SOURCE += [ FDirName $(librootSources) os arch generic ] ;
+
+local librootSources = [ FDirName $(HAIKU_TOP) src system libroot ] ;
+local posixSources = [ FDirName $(librootSources) posix ] ;
+
+SEARCH_SOURCE += [ FDirName $(librootSources) os arch $(TARGET_ARCH) ] ;
+SEARCH_SOURCE += [ FDirName $(librootSources) os arch generic ] ;
+
+KernelMergeObject kernel_os_arch_$(TARGET_ARCH).o :
+ generic_system_time_nsecs.cpp
+ : $(TARGET_KERNEL_PIC_CCFLAGS)
+;
+
+SEARCH_SOURCE += [ FDirName $(posixSources) arch $(TARGET_ARCH) ] ;
+SEARCH_SOURCE += [ FDirName $(posixSources) string arch generic ] ;
+SEARCH_SOURCE += [ FDirName $(posixSources) string arch $(TARGET_ARCH) ] ;
+
+KernelMergeObject kernel_lib_posix_arch_$(TARGET_ARCH).o :
+ siglongjmp.S
+ sigsetjmp.S
+
+ memcpy.c
+ memset.c
+ : $(TARGET_KERNEL_PIC_CCFLAGS)
+;
diff --git a/src/system/ldscripts/sparc/kernel.ld
b/src/system/ldscripts/sparc/kernel.ld
new file mode 100644
index 0000000000..07866a664c
--- /dev/null
+++ b/src/system/ldscripts/sparc/kernel.ld
@@ -0,0 +1,60 @@
+OUTPUT_FORMAT("elf64-sparc")
+OUTPUT_ARCH(sparc:v9)
+
+ENTRY(_start)
+SECTIONS
+{
+ . = 0xFFFFFFFF80000000 + SIZEOF_HEADERS;
+
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rela.got : { *(.rela.got) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rela.init : { *(.rela.init) }
+ .rela.fini : { *(.rela.fini) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rela.plt : { *(.rela.plt) }
+ .init : { *(.init) } =0x90909090
+ .plt : { *(.plt) }
+
+ /* text/read-only data */
+ .text : { *(.text .text.* .gnu.linkonce.t.*) } =0x90909090
+
+ .rodata : { *(.rodata) }
+
+ . = ALIGN(0x8);
+ altcodepatch_begin = .;
+ .altcodepatch : { *(.altcodepatch) }
+ altcodepatch_end = .;
+
+ /* writable data */
+ . = ALIGN(0x1000);
+ __data_start = .;
+ .data : { *(.data .gnu.linkonce.d.*) }
+
+ . = ALIGN(0x4);
+ __ctor_list = .;
+ .ctors : { *(.ctors) }
+ __ctor_end = .;
+ __dtor_list = .;
+ .dtors : { *(.dtors) }
+ __dtor_end = .;
+ .got : { *(.got.plt) *(.got) }
+ .dynamic : { *(.dynamic) }
+
+ /* uninitialized data (in same segment as writable data) */
+ __bss_start = .;
+ .bss : { *(.bss) }
+
+ . = ALIGN(0x1000);
+ _end = . ;
+
+ /* Strip unnecessary stuff */
+ /DISCARD/ : { *(.comment .note .eh_frame) }
+}
diff --git a/src/system/libroot/posix/arch/sparc/Jamfile
b/src/system/libroot/posix/arch/sparc/Jamfile
new file mode 100644
index 0000000000..591da4d161
--- /dev/null
+++ b/src/system/libroot/posix/arch/sparc/Jamfile
@@ -0,0 +1,26 @@
+SubDir HAIKU_TOP src system libroot posix arch sparc ;
+
+local architectureObject ;
+for architectureObject in [ MultiArchSubDirSetup sparc ] {
+ on $(architectureObject) {
+ local architecture = $(TARGET_PACKAGING_ARCH) ;
+
+ UsePrivateSystemHeaders ;
+
+ local genericSources =
+ setjmp_save_sigs.c
+ longjmp_return.c
+ ;
+
+ MergeObject <$(architecture)>posix_arch_$(TARGET_ARCH).o :
+ sigsetjmp.S
+ siglongjmp.S
+
+ $(genericSources)
+ ;
+
+ SEARCH on [ FGristFiles $(genericSources) ]
+ = [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
+ }
+}
+
diff --git a/src/system/libroot/posix/arch/sparc/siglongjmp.S
b/src/system/libroot/posix/arch/sparc/siglongjmp.S
new file mode 100644
index 0000000000..a2f3b962d7
--- /dev/null
+++ b/src/system/libroot/posix/arch/sparc/siglongjmp.S
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx
+ * Distributed under the terms of the Haiku License.
+ */
+
+
+#include <asm_defs.h>
+
+
+/* int __siglongjmp(jmp_buf buffer, int value) */
+FUNCTION(siglongjmp):
+FUNCTION(longjmp):
+FUNCTION(_longjmp):
+ ret
+FUNCTION_END(siglongjmp)
+FUNCTION_END(longjmp)
+FUNCTION_END(_longjmp)
+
+#pragma weak longjmp=siglongjmp
+
diff --git a/src/system/libroot/posix/arch/sparc/sigsetjmp.S
b/src/system/libroot/posix/arch/sparc/sigsetjmp.S
new file mode 100644
index 0000000000..594f881460
--- /dev/null
+++ b/src/system/libroot/posix/arch/sparc/sigsetjmp.S
@@ -0,0 +1,13 @@
+/* Copyright 2019, Adrien Destugues, pulkomandy@xxxxxxxxxxxxx.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include <asm_defs.h>
+
+
+/* int setjmp(jmp_buf buffer) */
+FUNCTION(setjmp):
+FUNCTION(_setjmp):
+ ret
+FUNCTION_END(setjmp)