Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsaio/saio_internal.h

1/*
2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999-2003 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 2.0 (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 */
31extern void real_to_prot(void);
32extern void prot_to_real(void);
33extern void halt(void);
34extern void startprog(unsigned int address, void *arg);
35#ifdef NBP_SUPPORT
36extern void loader(UInt32 code, UInt32 cmdptr);
37#endif
38
39/* bios.s */
40extern void bios(biosBuf_t *bb);
41
42/* biosfn.c */
43#ifdef EISA_SUPPORT
44extern bool eisa_present(void);
45#endif
46extern int bgetc(void);
47extern int biosread(int dev, int cyl, int head, int sec, int num);
48extern int ebiosread(int dev, unsigned long long sec, int count);
49extern int ebioswrite(int dev, long sec, int count);
50extern int get_drive_info(int drive, struct driveInfo *dp);
51extern int ebiosEjectMedia(int biosdev);
52extern void putc(int ch);
53extern void putca(int ch, int attr, int repeat);
54extern int getc(void);
55extern void pause();
56extern int readKeyboardStatus(void);
57extern int readKeyboardShiftFlags(void);
58extern unsigned int time18(void);
59extern void delay(int ms);
60extern unsigned int get_diskinfo(int dev);
61#if APM_SUPPORT
62extern int APMPresent(void);
63extern int APMConnect32(void);
64#endif
65extern int memsize(int i);
66extern void video_mode(int mode);
67extern void setCursorPosition(int x, int y, int page);
68extern void setCursorType(int type);
69extern void getCursorPositionAndType(int *x, int *y, int *type);
70extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir);
71extern void clearScreenRows(int y1, int y2);
72extern void setActiveDisplayPage( int page );
73extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount,
74 unsigned long * conMemSizePtr, unsigned long * extMemSizePtr);
75extern unsigned long getExtendedMemorySize();
76extern unsigned long getConventionalMemorySize();
77extern void sleep(int n);
78
79/* bootstruct.c */
80extern void initKernBootStruct(void);
81extern void reserveKernBootStruct(void);
82extern void copyKernBootStruct(void);
83extern void finalizeBootStruct(void);
84extern void reserveKernLegacyBootStruct(void);
85
86/* cache.c */
87extern void CacheReset();
88extern void CacheInit(CICell ih, long blockSize);
89extern long CacheRead(CICell ih, char *buffer, long long offset,
90 long length, long cache);
91
92/* console.c */
93extern bool gVerboseMode;
94extern bool gErrors;
95extern void initBooterLog(void);
96extern void setupBooterLog(void);
97extern void putchar(int ch);
98extern int getchar(void);
99extern void msglog(const char * format, ...);
100extern int printf(const char *format, ...);
101extern int error(const char *format, ...);
102extern int verbose(const char *format, ...);
103extern void stop(const char *format, ...);
104
105/* disk.c */
106extern void rescanBIOSDevice(int biosdev);
107extern struct DiskBVMap* diskResetBootVolumes(int biosdev);
108extern void diskFreeMap(struct DiskBVMap *map);
109extern int testBiosread( int biosdev, unsigned long long secno );
110extern BVRef diskScanBootVolumes(int biosdev, int *count);
111extern void diskSeek(BVRef bvr, long long position);
112extern int diskRead(BVRef bvr, long addr, long length);
113extern int diskIsCDROM(BVRef bvr);
114extern int biosDevIsCDROM(int biosdev);
115extern BVRef getBVChainForBIOSDev(int biosdev);
116extern BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count);
117extern int freeFilteredBVChain(const BVRef chain);
118extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len);
119extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len);
120extern int readBootSector(int biosdev, unsigned int secno, void *buffer);
121extern int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer );
122
123/* hfs_compare.c */
124extern int32_t FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1,
125 u_int16_t *uniStr2, u_int32_t len2, int byte_order);
126extern void utf_encodestr( const u_int16_t * ucsp, int ucslen,
127 u_int8_t * utf8p, u_int32_t bufsize, int byte_order );
128extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp,
129 u_int16_t *ucslen, u_int32_t bufsize, int byte_order );
130
131/* load.c */
132extern bool gHaveKernelCache;
133extern long ThinFatFile(void **binary, unsigned long *length);
134extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize);
135
136/* memory.c */
137long AllocateKernelMemory( long inSize );
138#if UNUSED
139long
140AllocateMemoryRange(char * rangeName, long start, long length, long type);
141#else
142long
143AllocateMemoryRange(char * rangeName, long start, long length);
144#endif
145/* misc.c */
146extern void enableA20(void);
147extern void turnOffFloppy(void);
148
149extern void getPlatformName(char *nameBuf);
150
151#ifdef NBP_SUPPORT
152/* nbp.c */
153extern UInt32 nbpUnloadBaseCode();
154extern BVRef nbpScanBootVolumes(int biosdev, int *count);
155#endif
156
157/* stringTable.c */
158extern char * newStringFromList(char **list, int *size);
159extern int stringLength(const char *table, int compress);
160extern bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size);
161extern bool removeKeyFromTable(const char *key, char *table);
162extern char * newStringForStringTableKey(config_file_t *config, char *key);
163extern char * newStringForKey(char *key, config_file_t *configBuff);
164extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len);
165extern bool getValueForKey(const char *key, const char **val, int *size, config_file_t *configBuff);
166extern const char * getStringForKey(const char * key, config_file_t *config);
167extern bool getBoolForKey(const char *key, bool *val, config_file_t *configBuff);
168extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff);
169extern bool getColorForKey(const char *key, unsigned int *val, config_file_t *configBuff);
170extern bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size );
171extern int loadConfigFile(const char *configFile, config_file_t *configBuff);
172extern int loadSystemConfig(config_file_t *configBuff);
173#ifdef BOOT_HELPER_SUPPORT
174extern int loadHelperConfig(config_file_t *configBuff);
175#endif
176extern int loadOverrideConfig(config_file_t *configBuff);
177extern char * newString(const char *oldString);
178extern char * getNextArg(char ** ptr, char * val);
179extern int ParseXMLFile( char * buffer, TagPtr * dict );
180
181/* sys.c */
182extern BVRef getBootVolumeRef( const char * path, const char ** outPath );
183extern long LoadVolumeFile(BVRef bvr, const char *fileSpec);
184extern long LoadFile(const char *fileSpec);
185extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length);
186extern long LoadThinFatFile(const char *fileSpec, void **binary);
187extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,
188 long *flags, long *time);
189extern long GetFileInfo(const char *dirSpec, const char *name,
190 long *flags, long *time);
191extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock);
192extern long GetFSUUID(char *spec, char *uuidStr);
193extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr);
194extern int openmem(char *buf, int len);
195#if UNUSED
196extern int open(const char *path, int flags);
197#else
198extern int open(const char *path);
199#endif
200#if UNUSED
201extern int open_bvdev(const char *bvd, const char *path, int flags);
202#else
203extern int open_bvdev(const char *bvd, const char *path);
204#endif
205extern int close(int fdesc);
206extern int file_size(int fdesc);
207extern int read(int fdesc, char *buf, int count);
208extern int write(int fdesc, const char *buf, int count);
209extern int writebyte(int fdesc, char value);
210extern int writeint(int fdesc, int value);
211extern int b_lseek(int fdesc, int addr, int ptr);
212extern int tell(int fdesc);
213extern const char * systemConfigDir(void);
214extern struct dirstuff * opendir(const char *path);
215extern struct dirstuff * vol_opendir(BVRef bvr, const char *path);
216extern int closedir(struct dirstuff *dirp);
217extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time);
218extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags,
219 long * time, FinderInfo *finderInfo, long *infoValid);
220extern void flushdev(void);
221extern void scanBootVolumes(int biosdev, int *count);
222#if UNUSED
223extern void scanDisks(int biosdev, int *count);
224#else
225extern void scanDisks(void);
226#endif
227extern BVRef selectBootVolume(BVRef chain);
228extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose);
229extern void setRootVolume(BVRef volume);
230extern void setBootGlobals(BVRef chain);
231extern int getDeviceDescription(BVRef volume, char *str);
232
233extern int gBIOSDev;
234extern int gBootFileType;
235extern BVRef gBootVolume;
236extern BVRef gBIOSBootVolume;
237
238/* smp.c */
239extern void * getMPSTable();
240
241
242#endif /* !__LIBSAIO_SAIO_INTERNAL_H */
243

Archive Download this file

Revision: 1119