aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2021-02-11 05:20:39 +0100
committerHelge Deller <deller@gmx.de>2021-09-24 11:10:17 +0200
commit4099efc76f7304c3ce041e5adcafcb6303db179e (patch)
treefe548be13302b7fd4a24273bb62238fbeb0cc955
parent4cf8840efb003bdd21282f07c1024f3647d73798 (diff)
downloadseabios-hppa-4099efc76f7304c3ce041e5adcafcb6303db179e.zip
seabios-hppa-4099efc76f7304c3ce041e5adcafcb6303db179e.tar.gz
seabios-hppa-4099efc76f7304c3ce041e5adcafcb6303db179e.tar.bz2
stacks.h: Provide replacement for thread functions when !CONFIG_THREADS
Rearrange the thread functions and provide wrappers which evaluates to no code when !CONFIG_THREADS. The function call16_int() isn't used on PA-RISC, so replace it by an empty function call. Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/stacks.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/stacks.h b/src/stacks.h
index c71bdc8..518bd83 100644
--- a/src/stacks.h
+++ b/src/stacks.h
@@ -2,6 +2,7 @@
#ifndef __STACKS_H
#define __STACKS_H
+#include "autoconf.h" // CONFIG_*
#include "types.h" // u32
#define CALL32SMM_CMDID 0xb5
@@ -28,20 +29,32 @@ int on_extra_stack(void);
struct bregs;
void farcall16(struct bregs *callregs);
void farcall16big(struct bregs *callregs);
+#if CONFIG_X86
void __call16_int(struct bregs *callregs, u16 offset);
#define call16_int(nr, callregs) do { \
extern void irq_trampoline_ ##nr (void); \
__call16_int((callregs), (u32)&irq_trampoline_ ##nr ); \
} while (0)
+#elif CONFIG_PARISC
+#define call16_int(nr, callregs) do {} while(0)
+#endif
void reset(void);
extern struct thread_info MainThread;
struct thread_info *getCurThread(void);
-void yield(void);
void yield_toirq(void);
-void thread_setup(void);
+#if CONFIG_THREADS
int threads_during_optionroms(void);
+void yield(void);
+void thread_setup(void);
void run_thread(void (*func)(void*), void *data);
void wait_threads(void);
+#else
+#define threads_during_optionroms() (0)
+#define yield() while (0)
+#define thread_setup() while (0)
+#define run_thread(func,data) func(data)
+#define wait_threads() while (0)
+#endif
struct mutex_s { u32 isLocked; };
void mutex_lock(struct mutex_s *mutex);
void mutex_unlock(struct mutex_s *mutex);