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