Root/
Source at commit 1302 created 12 years 7 months ago. By meklort, Clean up libsaio | |
---|---|
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 */␊ |
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 char 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, unsigned long long sec, int count);␊ |
47 | extern int ebioswrite(int dev, long sec, int count);␊ |
48 | extern int ebiosEjectMedia(int biosdev);␊ |
49 | extern void␉ bios_putchar(int ch);␊ |
50 | extern void putca(int ch, int attr, int repeat);␊ |
51 | extern int readKeyboardStatus(void);␊ |
52 | extern int readKeyboardShiftFlags(void);␊ |
53 | extern unsigned int time18(void);␊ |
54 | extern void delay(int ms);␊ |
55 | extern unsigned int get_diskinfo(int dev);␊ |
56 | #if APM_SUPPORT␊ |
57 | extern int APMPresent(void);␊ |
58 | extern int APMConnect32(void);␊ |
59 | #endif␊ |
60 | extern int memsize(int i);␊ |
61 | extern void video_mode(int mode);␊ |
62 | extern void setCursorPosition(int x, int y, int page);␊ |
63 | extern void setCursorType(int type);␊ |
64 | extern void getCursorPositionAndType(int *x, int *y, int *type);␊ |
65 | extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir);␊ |
66 | extern void clearScreenRows(int y1, int y2);␊ |
67 | extern void setActiveDisplayPage( int page );␊ |
68 | extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount,␊ |
69 | unsigned long * conMemSizePtr, unsigned long * extMemSizePtr);␊ |
70 | extern unsigned long getExtendedMemorySize();␊ |
71 | extern unsigned long getConventionalMemorySize();␊ |
72 | extern void sleep(int n);␊ |
73 | ␊ |
74 | /* console.c */␊ |
75 | extern void initBooterLog(void);␊ |
76 | extern void msglog(const char * format, ...);␊ |
77 | extern void setupBooterLog(void);␊ |
78 | extern int putchar(int ch);␊ |
79 | extern int getchar(void);␊ |
80 | extern int printf(const char *format, ...);␊ |
81 | extern int error(const char *format, ...);␊ |
82 | extern int verbose(const char *format, ...);␊ |
83 | extern void stop(const char *format, ...);␊ |
84 | //Azi: replace getc/getchar with ? console.c␊ |
85 | extern void pause();␊ |
86 | ␊ |
87 | /* load.c */␊ |
88 | extern long ThinFatFile(void **binary, unsigned long *length);␊ |
89 | extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
90 | ␊ |
91 | /* memory.c */␊ |
92 | long AllocateKernelMemory( long inSize );␊ |
93 | long AllocateMemoryRange(char * rangeName, long start, long length, long type);␊ |
94 | ␊ |
95 | /* sys.c */␊ |
96 | extern BVRef getBootVolumeRef( const char * path, const char ** outPath );␊ |
97 | extern long LoadVolumeFile(BVRef bvr, const char *fileSpec);␊ |
98 | extern long LoadFile(const char *fileSpec);␊ |
99 | extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length);␊ |
100 | extern long LoadThinFatFile(const char *fileSpec, void **binary);␊ |
101 | extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,␊ |
102 | long *flags, long *time);␊ |
103 | extern long GetFileInfo(const char *dirSpec, const char *name,␊ |
104 | long *flags, long *time);␊ |
105 | extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock);␊ |
106 | extern long GetFSUUID(char *spec, char *uuidStr);␊ |
107 | extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr);␊ |
108 | extern int openmem(char *buf, int len);␊ |
109 | extern int open(const char *str, int how);␊ |
110 | extern int open_bvdev(const char *bvd, const char *path, int flags);␊ |
111 | extern int close(int fdesc);␊ |
112 | extern int file_size(int fdesc);␊ |
113 | extern int read(int fdesc, char *buf, int count);␊ |
114 | extern int write(int fdesc, const char *buf, int count);␊ |
115 | extern int writebyte(int fdesc, char value);␊ |
116 | extern int writeint(int fdesc, int value);␊ |
117 | extern int b_lseek(int fdesc, int addr, int ptr);␊ |
118 | extern int tell(int fdesc);␊ |
119 | extern const char * systemConfigDir(void);␊ |
120 | extern struct dirstuff * opendir(const char *path);␊ |
121 | extern struct dirstuff * vol_opendir(BVRef bvr, const char *path);␊ |
122 | extern int closedir(struct dirstuff *dirp);␊ |
123 | extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time);␊ |
124 | extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags,␊ |
125 | long * time, FinderInfo *finderInfo, long *infoValid);␊ |
126 | extern void flushdev(void);␊ |
127 | extern void scanBootVolumes(int biosdev, int *count);␊ |
128 | extern void scanDisks(int biosdev, int *count);␊ |
129 | extern BVRef selectBootVolume(BVRef chain);␊ |
130 | extern void setRootVolume(BVRef volume);␊ |
131 | extern void setBootGlobals(BVRef chain);␊ |
132 | extern int getDeviceDescription(BVRef volume, char *str);␊ |
133 | ␊ |
134 | extern int gBIOSDev;␊ |
135 | extern int gBootFileType;␊ |
136 | extern BVRef gBootVolume;␊ |
137 | extern BVRef gBIOSBootVolume;␊ |
138 | ␊ |
139 | // Function pointer to be filled in if ramdisks are available␊ |
140 | extern int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno,␊ |
141 | unsigned int byteoff,␊ |
142 | unsigned int byteCount, void * buffer );␊ |
143 | ␊ |
144 | #endif /* !__LIBSAIO_SAIO_INTERNAL_H */␊ |
145 |