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