libstubs.h revision 1.1 1 /*
2 * $NetBSD: libstubs.h,v 1.1 1996/11/29 23:36:29 is Exp $
3 *
4 * Copyright (c) 1996 Ignatios Souvatzis
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Ignatios Souvatzis
18 * for the NetBSD project.
19 * 4. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
34
35 #include "amigaio.h"
36 #include "amigagraph.h"
37 #include "amigatypes.h"
38 #include <sys/types.h>
39
40 extern struct ExecBase *SysBase;
41 extern struct Library *IntuitionBase;
42 extern struct Library *ExpansionBase;
43
44 void *AllocMem (size_t, u_int32_t);
45 void FreeMem (void *, size_t);
46
47 struct Library *OpenLibrary (const char *, u_int32_t);
48 void CloseLibrary (struct Library *);
49 struct MsgPort *CreateMsgPort(void);
50 void *CreateIORequest(struct MsgPort *, u_int32_t);
51 void DeleteIORequest(void *);
52 void DeleteMsgPort(struct MsgPort *);
53
54 u_int8_t DoIO(struct AmigaIO *);
55 void SendIO(struct AmigaIO *);
56 struct AmigaIO *CheckIO(struct AmigaIO *);
57 void *WaitPort(struct MsgPort *);
58 void AbortIO(struct AmigaIO *);
59 u_int8_t WaitIO(struct AmigaIO *);
60
61 int OpenDevice(const char *, u_int32_t, struct AmigaIO *, u_int32_t);
62
63 void *FindResident(const char *);
64 void *OpenResource(const char *);
65
66 u_int32_t CachePreDMA(u_int32_t, u_int32_t *, int);
67 #define DMAF_Continue 2
68 #define DMAF_NoModify 4
69 #define DMAF_ReadFromRAM 8
70
71 void Forbid(void);
72 void Permit(void);
73
74 struct Screen *OpenScreenTagList(struct NewScreen *, const u_int32_t *);
75 struct Screen *OpenScreenTag(struct NewScreen *, ...);
76 struct Window *OpenWindowTagList(struct Window *, const u_int32_t *);
77 struct Window *OpenWindowTag(struct Window *, ...);
78
79 #ifdef nomore
80 u_int32_t mytime(void);
81 #endif
82
83 struct cfdev *FindConfigDev(struct cfdev *, int, int);
84
85 #ifndef DOINLINES
86 void CacheClearU(void);
87 #else
88 #define LibCallNone(lib, what) \
89 asm("movl a6,sp@-; movl %0,a6; " what "; movl sp@+,a6" :: \
90 "r"(lib) : "d0", "d1", "a0", "a1")
91
92 #define CacheClearU() LibCallNone(SysBase, "jsr a6@(-0x27c)")
93 #endif
94