|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * Call (some) Amiga Exec functions outside the main UAE thread
5: * and without stack magic.
6: *
7: * Copyright 1999 Patrick Ohly
1.1.1.4 root 8: *
1.1 root 9: * Uses the EXTER interrupt that is setup in filesys.c
10: * and some of it needs thread support.
11: */
12:
13: /*
14: * The following functions do exactly the same thing as their
15: * Amiga counterpart, but can be called in situation where calling
16: * the exec.library functions is impossible.
17: */
18: #ifdef SUPPORT_THREADS
1.1.1.5 ! root 19: extern void uae_ReplyMsg (uaecptr msg);
! 20: extern void uae_PutMsg (uaecptr port, uaecptr msg);
! 21: extern void uae_Signal (uaecptr task, uae_u32 mask);
1.1 root 22: #endif
1.1.1.5 ! root 23: extern void uae_NewList (uaecptr list);
1.1 root 24:
25: /*
26: * The following functions are shortcuts for calling
1.1.1.5 ! root 27: * the exec.library function with CallLib (), so they
1.1 root 28: * are only available in a trap function. This trap
29: * function has to be setup with deftrap2() and
30: * TRAPFLAG_EXTRA_STACK and stack magic is required.
31: */
1.1.1.5 ! root 32: extern uaecptr uae_AllocMem (TrapContext *, uae_u32 size, uae_u32 flags);
! 33: extern void uae_FreeMem (TrapContext *ctx, uaecptr memory, uae_u32 size);
1.1 root 34:
35:
36: /*
37: * to be called when setting up the hardware
38: */
1.1.1.5 ! root 39: extern void native2amiga_install (void);
1.1 root 40:
41: /*
42: * to be called when the Amiga boots, i.e. by filesys_diagentry()
43: */
1.1.1.5 ! root 44: extern void native2amiga_startup (void);
1.1 root 45:
46: /**** internal stuff ****/
47: #ifdef SUPPORT_THREADS
48: /* This pipe is filled by Signal() with pairs of
49: * (uae_u32)0/(uaecptr)task/(uae_u32)signal_set,
50: * by PutMsg() with (uae_u32)1/(uaecptr)port/(uaecptr)msg and by
51: * ReplyMsg() with (uae_u32)2/(uaecptr)msg.
52: * It's emptied via exter_int_helper by the EXTER interrupt. */
53: extern smp_comm_pipe native2amiga_pending;
54: #endif
1.1.1.3 root 55:
1.1.1.5 ! root 56: STATIC_INLINE void do_uae_int_requested (void)
1.1.1.3 root 57: {
58: uae_int_requested = 1;
59: set_uae_int_flag ();
60: INTREQ (0x8000 | 0x0008);
61: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.