]> git.saurik.com Git - apple/boot.git/blob - i386/libsaio/saio_internal.h
c513fca3a196448efbc787a16bdfe0788c141b6d
[apple/boot.git] / i386 / libsaio / saio_internal.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25 #ifndef __LIBSAIO_SAIO_INTERNAL_H
26 #define __LIBSAIO_SAIO_INTERNAL_H
27
28 #include "saio_types.h"
29
30 /* asm.s */
31 extern void real_to_prot(void);
32 extern void prot_to_real(void);
33 extern void halt(void);
34 extern void startprog(unsigned int address, void *arg);
35 extern void loader(UInt32 code, UInt32 cmdptr);
36
37 /* bios.s */
38 extern void bios(biosBuf_t *bb);
39
40 /* biosfn.c */
41 #ifdef EISA_SUPPORT
42 extern BOOL eisa_present(void);
43 #endif
44 extern int bgetc(void);
45 extern int biosread(int dev, int cyl, int head, int sec, int num);
46 extern int ebiosread(int dev, long sec, int count);
47 extern int get_drive_info(int drive, struct driveInfo *dp);
48 extern void putc(int ch);
49 extern void putca(int ch, int attr, int repeat);
50 extern int getc(void);
51 extern int readKeyboardStatus(void);
52 extern unsigned int time18(void);
53 extern void delay(int ms);
54 extern unsigned int get_diskinfo(int dev);
55 extern int APMPresent(void);
56 extern int APMConnect32(void);
57 extern int memsize(int i);
58 extern void video_mode(int mode);
59 extern void setCursorPosition(int x, int y, int page);
60 extern void setCursorType(int type);
61 extern void getCursorPositionAndType(int *x, int *y, int *type);
62 extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir);
63 extern void clearScreenRows(int y1, int y2);
64 extern void setActiveDisplayPage( int page );
65 extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount,
66 unsigned long * conMemSizePtr, unsigned long * extMemSizePtr);
67 extern unsigned long getExtendedMemorySize();
68 extern unsigned long getConventionalMemorySize();
69 extern void sleep(int n);
70
71 /* bootstruct.c */
72 extern void initKernBootStruct(int biosdev);
73 extern void reserveKernBootStruct(void);
74 extern void copyKernBootStruct(void);
75
76 /* cache.c */
77 extern void CacheInit(CICell ih, long blockSize);
78 extern long CacheRead(CICell ih, char *buffer, long long offset,
79 long length, long cache);
80
81 /* console.c */
82 extern BOOL gVerboseMode;
83 extern BOOL gErrors;
84 extern void putchar(int ch);
85 extern int getchar(void);
86 extern int printf(const char *format, ...);
87 extern int error(const char *format, ...);
88 extern int verbose(const char *format, ...);
89 extern void stop(const char *message);
90
91 /* disk.c */
92 extern BVRef diskScanBootVolumes(int biosdev, int *count);
93 extern void diskSeek(BVRef bvr, long long position);
94 extern int diskRead(BVRef bvr, long addr, long length);
95 extern int readBootSector(int biosdev, unsigned int secno, void *buffer);
96 extern void turnOffFloppy(void);
97
98 /* load.c */
99 extern char gHaveKernelCache;
100 extern long ThinFatFile(void **binary, unsigned long *length);
101 extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize);
102
103 /* memory.c */
104 long AllocateKernelMemory( long inSize );
105 long AllocateMemoryRange(char * rangeName, long start, long length, long type);
106
107 /* misc.c */
108 extern void enableA20(void);
109
110 /* nbp.c */
111 extern UInt32 nbpUnloadBaseCode();
112 extern BVRef nbpScanBootVolumes(int biosdev, int *count);
113
114 /* stringTable.c */
115 extern char * newStringFromList(char **list, int *size);
116 extern int stringLength(const char *table, int compress);
117 extern BOOL getValueForStringTableKey(const char *table, const char *key, const char **val, int *size);
118 extern BOOL removeKeyFromTable(const char *key, char *table);
119 extern char * newStringForStringTableKey(char *table, char *key);
120 extern char * newStringForKey(char *key);
121 extern BOOL getValueForBootKey(const char *line, const char *match, const char **matchval, int *len);
122 extern BOOL getValueForKey(const char *key, const char **val, int *size);
123 extern BOOL getBoolForKey(const char *key);
124 extern BOOL getIntForKey(const char *key, int *val);
125 extern int loadConfigFile(const char *configFile, const char **table, BOOL allocTable);
126 extern int loadConfigDir(const char *bundleName, BOOL useDefault, const char **table,
127 BOOL allocTable);
128 extern int loadSystemConfig(const char *which, int size);
129 extern void addConfig(const char *config);
130 extern char * newString(const char *oldString);
131
132 /* sys.c */
133 extern long LoadFile(const char *fileSpec);
134 extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name,
135 long *flags, long *time);
136 extern long GetFileInfo(const char *dirSpec, const char *name,
137 long *flags, long *time);
138 extern int openmem(char *buf, int len);
139 extern int open(const char *str, int how);
140 extern int close(int fdesc);
141 extern int file_size(int fdesc);
142 extern int read(int fdesc, char *buf, int count);
143 extern int b_lseek(int fdesc, int addr, int ptr);
144 extern int tell(int fdesc);
145 extern const char * usrDevices(void);
146 extern const char * systemConfigDir(void);
147 extern struct dirstuff * opendir(const char *path);
148 extern int closedir(struct dirstuff *dirp);
149 extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time);
150 extern void flushdev(void);
151 extern int currentdev(void);
152 extern int switchdev(int dev);
153 extern BVRef scanBootVolumes(int biosdev, int *count);
154 extern BVRef selectBootVolume(BVRef chain);
155 extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen);
156
157 extern int gBIOSDev;
158 extern int gBootFileType;
159
160 #endif /* !__LIBSAIO_SAIO_INTERNAL_H */