Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/arch/i386/libsaio/saio_internal.h

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

Archive Download this file

Revision: 1302