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