libstubs.h revision 1.8 1 1.8 abs /* $NetBSD: libstubs.h,v 1.8 2023/03/25 20:14:26 abs 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 *
19 1.2 is * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.2 is * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.2 is * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.2 is * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.2 is * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.2 is * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.2 is * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.2 is * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.2 is * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.2 is * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.2 is * POSSIBILITY OF SUCH DAMAGE.
30 1.1 is */
31 1.1 is
32 1.1 is #include "amigaio.h"
33 1.1 is #include "amigagraph.h"
34 1.1 is #include "amigatypes.h"
35 1.1 is #include <sys/types.h>
36 1.1 is
37 1.1 is extern struct ExecBase *SysBase;
38 1.1 is extern struct Library *IntuitionBase;
39 1.1 is extern struct Library *ExpansionBase;
40 1.1 is
41 1.1 is void *AllocMem (size_t, u_int32_t);
42 1.1 is void FreeMem (void *, size_t);
43 1.1 is
44 1.1 is struct Library *OpenLibrary (const char *, u_int32_t);
45 1.1 is void CloseLibrary (struct Library *);
46 1.1 is struct MsgPort *CreateMsgPort(void);
47 1.1 is void *CreateIORequest(struct MsgPort *, u_int32_t);
48 1.1 is void DeleteIORequest(void *);
49 1.1 is void DeleteMsgPort(struct MsgPort *);
50 1.1 is
51 1.1 is u_int8_t DoIO(struct AmigaIO *);
52 1.1 is void SendIO(struct AmigaIO *);
53 1.1 is struct AmigaIO *CheckIO(struct AmigaIO *);
54 1.1 is void *WaitPort(struct MsgPort *);
55 1.1 is void AbortIO(struct AmigaIO *);
56 1.1 is u_int8_t WaitIO(struct AmigaIO *);
57 1.1 is
58 1.7 mlelstv void RawIOInit(void);
59 1.7 mlelstv int32_t RawPutChar(int32_t c);
60 1.7 mlelstv int32_t RawMayGetChar(void);
61 1.7 mlelstv
62 1.1 is int OpenDevice(const char *, u_int32_t, struct AmigaIO *, u_int32_t);
63 1.4 mhitch #ifdef _PRIMARY_BOOT
64 1.4 mhitch void CloseDevice(struct AmigaIO *);
65 1.4 mhitch #endif
66 1.1 is
67 1.1 is void *FindResident(const char *);
68 1.8 abs void *InitResident(const char *, u_int32_t);
69 1.1 is void *OpenResource(const char *);
70 1.1 is
71 1.1 is u_int32_t CachePreDMA(u_int32_t, u_int32_t *, int);
72 1.1 is #define DMAF_Continue 2
73 1.1 is #define DMAF_NoModify 4
74 1.1 is #define DMAF_ReadFromRAM 8
75 1.1 is
76 1.1 is void Forbid(void);
77 1.1 is void Permit(void);
78 1.1 is
79 1.1 is struct Screen *OpenScreenTagList(struct NewScreen *, const u_int32_t *);
80 1.1 is struct Screen *OpenScreenTag(struct NewScreen *, ...);
81 1.1 is struct Window *OpenWindowTagList(struct Window *, const u_int32_t *);
82 1.1 is struct Window *OpenWindowTag(struct Window *, ...);
83 1.4 mhitch #ifdef _PRIMARY_BOOT
84 1.4 mhitch void CloseScreen(struct Screen *);
85 1.4 mhitch void CloseWindow(struct Window *);
86 1.4 mhitch #endif
87 1.1 is
88 1.1 is #ifdef nomore
89 1.1 is u_int32_t mytime(void);
90 1.1 is #endif
91 1.1 is
92 1.1 is struct cfdev *FindConfigDev(struct cfdev *, int, int);
93 1.1 is
94 1.1 is #ifndef DOINLINES
95 1.1 is void CacheClearU(void);
96 1.1 is #else
97 1.1 is #define LibCallNone(lib, what) \
98 1.5 perry __asm("movl a6,sp@-; movl %0,a6; " what "; movl sp@+,a6" :: \
99 1.1 is "r"(lib) : "d0", "d1", "a0", "a1")
100 1.1 is
101 1.1 is #define CacheClearU() LibCallNone(SysBase, "jsr a6@(-0x27c)")
102 1.1 is #endif
103