|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * Call Amiga Exec functions outside the main UAE thread.
5: *
6: * Copyright 1999 Patrick Ohly
1.1.1.5 ! root 7: *
1.1 root 8: * Uses the EXTER interrupt that is setup in filesys.c
9: * and needs thread support.
10: */
11:
12: #include "sysconfig.h"
13: #include "sysdeps.h"
14:
15: #include "config.h"
1.1.1.4 root 16: #include "threaddep/thread.h"
1.1 root 17: #include "options.h"
18: #include "memory.h"
19: #include "custom.h"
20: #include "newcpu.h"
21: #include "disk.h"
22: #include "autoconf.h"
23: #include "filesys.h"
24: #include "execlib.h"
25: #include "native2amiga.h"
26:
27: smp_comm_pipe native2amiga_pending;
28:
29: /*
30: * to be called when setting up the hardware
31: */
32:
33: void native2amiga_install (void)
34: {
35: init_comm_pipe (&native2amiga_pending, 10, 2);
36: }
37:
38: /*
39: * to be called when the Amiga boots, i.e. by filesys_diagentry()
40: */
41: void native2amiga_startup (void)
42: {
43: }
44:
45: #ifdef SUPPORT_THREADS
1.1.1.2 root 46: void uae_ReplyMsg(uaecptr msg)
1.1 root 47: {
48: write_comm_pipe_int (&native2amiga_pending, 2, 0);
49: write_comm_pipe_u32 (&native2amiga_pending, msg, 1);
50:
51: uae_int_requested = 1;
52: }
53:
1.1.1.2 root 54: void uae_PutMsg(uaecptr port, uaecptr msg)
1.1 root 55: {
56: uae_pt data;
57: data.i = 1;
58: write_comm_pipe_int (&native2amiga_pending, 1, 0);
59: write_comm_pipe_u32 (&native2amiga_pending, port, 0);
60: write_comm_pipe_u32 (&native2amiga_pending, msg, 1);
61:
62: uae_int_requested = 1;
63: }
64:
1.1.1.2 root 65: void uae_Signal(uaecptr task, uae_u32 mask)
1.1 root 66: {
67: write_comm_pipe_int (&native2amiga_pending, 0, 0);
68: write_comm_pipe_u32 (&native2amiga_pending, task, 0);
69: write_comm_pipe_int (&native2amiga_pending, mask, 1);
1.1.1.5 ! root 70:
1.1 root 71: uae_int_requested = 1;
72: }
73: #endif
74:
1.1.1.2 root 75: void uae_NewList(uaecptr list)
1.1 root 76: {
77: put_long (list, list + 4);
78: put_long (list + 4, 0);
79: put_long (list + 8, list);
80: }
81:
1.1.1.2 root 82: uaecptr uae_AllocMem (uae_u32 size, uae_u32 flags)
1.1 root 83: {
84: m68k_dreg (regs, 0) = size;
85: m68k_dreg (regs, 1) = flags;
86: return CallLib (get_long (4), -198); /* AllocMem */
87: }
1.1.1.4 root 88:
89: void uae_FreeMem (uaecptr memory, uae_u32 size)
90: {
91: m68k_dreg (regs, 0) = size;
92: m68k_areg (regs, 1) = memory;
93: CallLib (get_long (4), -0xD2); /* FreeMem */
94: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.