Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 840