Commit 2ba2c71c authored by kwyxz's avatar kwyxz
Browse files

Enable build on Haiku target

parent 74c4ddf8
......@@ -107,7 +107,11 @@ ifneq (,$(findstring unix,$(platform)))
TARGET := $(TARGET_NAME)_libretro.$(EXT)
SHARED := -shared -Wl,--version-script=link.T
LDFLAGS += -Wl,--no-undefined
ifneq (,$(findstring Haiku,$(shell uname -s)))
LIBS += -lroot
else
LIBS += -lrt
endif
fpic = -fPIC
......
......@@ -723,13 +723,21 @@ void _vmem_bm_reset_nvmem(void)
VirtualFree(p_sh4rcb,sizeof(p_sh4rcb->fpcb),MEM_DECOMMIT);
#else
mprotect(p_sh4rcb, sizeof(p_sh4rcb->fpcb), PROT_NONE);
#ifdef __HAIKU__
posix_madvise(p_sh4rcb,sizeof(p_sh4rcb->fpcb),POSIX_MADV_DONTNEED);
#else
madvise(p_sh4rcb,sizeof(p_sh4rcb->fpcb),MADV_DONTNEED);
#endif
#ifdef MADV_REMOVE
madvise(p_sh4rcb,sizeof(p_sh4rcb->fpcb),MADV_REMOVE);
#else
#ifdef __HAIKU__
posix_madvise(p_sh4rcb,sizeof(p_sh4rcb->fpcb),POSIX_MADV_DONTNEED);
#else
/* OSX, IOS */
madvise(p_sh4rcb,sizeof(p_sh4rcb->fpcb),MADV_FREE);
#endif
#endif
#endif
printf("Freeing fpcb\n");
......
#pragma once
#include "types.h"
#if defined(__HAIKU__)
#include <posix/sys/mman.h>
#endif
//Typedef's
//ReadMem
typedef u8 DYNACALL _vmem_ReadMem8FP(u32 Address);
......@@ -70,4 +74,4 @@ static inline bool _nvmem_enabled() {
return virt_ram_base != 0;
}
void _vmem_bm_reset();
\ No newline at end of file
void _vmem_bm_reset();
......@@ -38,6 +38,8 @@ u8 SH4_TCB[CODE_SIZE+4096]
__attribute__((section(".text")));
#elif defined(__MACH__)
__attribute__((section("__TEXT,.text")));
#elif defined(__HAIKU__)
__attribute__((section(".text")));
#else
#error SH4_TCB ALLOC
#endif
......
......@@ -9,9 +9,11 @@
#if !defined(TARGET_NO_EXCEPTIONS)
#ifndef _WIN32
#ifndef __HAIKU__
#include <ucontext.h>
#endif
#endif
#endif
#if defined(_ANDROID)
#include <asm/sigcontext.h>
......@@ -338,7 +340,7 @@ static void sigill_handler(int sn, siginfo_t * si, void *segfault_ctx)
}
#endif
#if defined(__MACH__) || defined(__linux__)
#if defined(__MACH__) || defined(__linux__) || defined(__HAIKU__)
//#define LOG_SIGHANDLER
static void signal_handler(int sn, siginfo_t * si, void *segfault_ctx)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment