Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Index: runtime/include/asm-base.h
===================================================================
--- runtime/include/asm-base.h (revision 3868)
+++ runtime/include/asm-base.h (working copy)
@@ -126,6 +126,17 @@
# define DOUBLE(V) .double V
# define LABEL(ID) ID:
# define __SC__ @
+
+# elif (defined(OPSYS_OPENBSD) && defined(TARGET_PPC))
+# define CFUNSYM(ID) CSYM(ID)
+# define CGLOBAL(ID) .globl CSYM(ID)
+# define TEXT .text
+# define DATA .data
+# define RO_DATA .data
+# define ALIGN4 .align 2
+# define ALIGN8 .align 3
+# define DOUBLE(V) .double V
+# define LABEL(ID) ID:
# endif
# define CENTRY(ID) \
Index: runtime/mach-dep/signal-sysdep.h
===================================================================
--- runtime/mach-dep/signal-sysdep.h (revision 3868)
+++ runtime/mach-dep/signal-sysdep.h (working copy)
@@ -331,6 +331,19 @@
# define SIG_ResetFPE(scp) { (scp)->regs->gpr[PT_FPSCR] = 0x0; }
typedef void SigReturn_t;
+# elif defined(OPSYS_OPENBSD)
+ /** PPC, OpenBSD **/
+
+# define SIG_FAULT1 SIGTRAP
+# define INT_DIVZERO(s, c) ((s) == SIGTRAP)
+# define INT_OVFLW(s, c) ((s) == SIGTRAP)
+# define SIG_GetPC(scp) ((scp)->sc_frame.srr0)
+# define SIG_SetPC(scp, addr) { (scp)->sc_frame.srr0 = (long)(addr); }
+# define SIG_ZeroLimitPtr(scp) { ((scp)->sc_frame.fixreg[15] = 0); } /* limitptr = 15 (see src/runtime/mach-dep/PPC.prim.asm) */
+# define SIG_GetCode(info,scp) (info)
+
+ typedef void SigReturn_t;
+
# endif /* HOST_RS6000/HOST_PPC */
#elif defined(HOST_HPPA)
Index: runtime/objs/mk.ppc-openbsd
===================================================================
--- runtime/objs/mk.ppc-openbsd (revision 0)
+++ runtime/objs/mk.ppc-openbsd (working copy)
@@ -0,0 +1,25 @@
+# mk.ppc-openbsd
+#
+# makefile for OpenBSD (version 4.x), which is a BSD 4.4 clone.
+#
+
+SHELL = /bin/sh
+
+MAKE = gmake
+
+ARFLAGS = Trcv
+CC ?= gcc -ansi
+CFLAGS ?= -O2
+CPP = gcc -x assembler-with-cpp -E -P
+
+XOBJS =
+XLIBS = ../c-libs/dl/libunix-dynload.a
+LD_LIBS =
+BASE_DEFS =
+DEFS = $(XDEFS) $(BASE_DEFS) -DHOST_PPC -DTARGET_PPC -DOPSYS_UNIX -DOPSYS_OPENBSD -DDLOPEN
+TARGET = PPC
+VERSION = v-ppc-openbsd
+RUNTIME = run.ppc-openbsd
+
+all:
+ ($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment