]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/ppc/Firmware.h
xnu-344.32.tar.gz
[apple/xnu.git] / osfmk / ppc / Firmware.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_FREE_COPYRIGHT@
24 */
25/*
26 * @APPLE_FREE_COPYRIGHT@
27 */
28
29/*
30 * Here be the firmware's public interfaces
31 * Lovingly crafted by Bill Angell using traditional methods
32*/
33
34#ifndef _FIRMWARE_H_
35#define _FIRMWARE_H_
36
37#ifndef __ppc__
38#error This file is only useful on PowerPC.
39#endif
40
41/*
42 * This routine is used to write debug output to either the modem or printer port.
43 * parm 1 is printer (0) or modem (1); parm 2 is ID (printed directly); parm 3 converted to hex
44 */
45
46void dbgDisp(unsigned int port, unsigned int id, unsigned int data);
47void dbgLog(unsigned int d0, unsigned int d1, unsigned int d2, unsigned int d3);
48void dbgLog2(unsigned int type, unsigned int p1, unsigned int p2);
49void dbgDispLL(unsigned int port, unsigned int id, unsigned int data);
50void fwSCCinit(unsigned int port);
51
52extern void dbgTrace(unsigned int item1, unsigned int item2, unsigned int item3);
53#if 0 /* (TEST/DEBUG) - eliminate inline */
54extern __inline__ void dbgTrace(unsigned int item1, unsigned int item2, unsigned int item3) {
55
56 __asm__ volatile("mr r3,%0" : : "r" (item1) : "r3");
57 __asm__ volatile("mr r4,%0" : : "r" (item2) : "r4");
58 __asm__ volatile("mr r5,%0" : : "r" (item3) : "r5");
59 __asm__ volatile("lis r0,hi16(CutTrace)" : : : "r0");
60 __asm__ volatile("ori r0,r0,lo16(CutTrace)" : : : "r0");
61 __asm__ volatile("sc");
62 return;
63}
64#endif
65
66extern void DoPreempt(void);
67extern __inline__ void DoPreempt(void) {
68 __asm__ volatile("lis r0,hi16(DoPreemptCall)" : : : "r0");
69 __asm__ volatile("ori r0,r0,lo16(DoPreemptCall)" : : : "r0");
70 __asm__ volatile("sc");
71 return;
72}
73
74extern void CreateFakeIO(void);
75extern __inline__ void CreateFakeIO(void) {
76 __asm__ volatile("lis r0,hi16(CreateFakeIOCall)" : : : "r0");
77 __asm__ volatile("ori r0,r0,lo16(CreateFakeIOCall)" : : : "r0");
78 __asm__ volatile("sc");
79 return;
80}
81
82extern void CreateFakeDEC(void);
83extern __inline__ void CreateFakeDEC(void) {
84 __asm__ volatile("lis r0,hi16(CreateFakeDECCall)" : : : "r0");
85 __asm__ volatile("ori r0,r0,lo16(CreateFakeDECCall)" : : : "r0");
86 __asm__ volatile("sc");
87 return;
88}
89
90extern void CreateShutdownCTX(void);
91extern __inline__ void CreateShutdownCTX(void) {
92 __asm__ volatile("lis r0,hi16(CreateShutdownCTXCall)" : : : "r0");
93 __asm__ volatile("ori r0,r0,lo16(CreateShutdownCTXCall)" : : : "r0");
94 __asm__ volatile("sc");
95 return;
96}
97
98extern void ChokeSys(unsigned int ercd);
99extern __inline__ void ChokeSys(unsigned int ercd) {
100 __asm__ volatile("mr r3,%0" : : "r" (ercd) : "r3");
101 __asm__ volatile("lis r0,hi16(Choke)" : : : "r0");
102 __asm__ volatile("ori r0,r0,lo16(Choke)" : : : "r0");
103 __asm__ volatile("sc");
104 return;
105}
106
107typedef struct Boot_Video bootBumbleC;
108
109extern void StoreReal(unsigned int val, unsigned int addr);
110extern void ReadReal(unsigned int raddr, unsigned int *vaddr);
111extern void ClearReal(unsigned int addr, unsigned int lgn);
112extern void LoadDBATs(unsigned int *bat);
113extern void LoadIBATs(unsigned int *bat);
114extern void stFloat(unsigned int *addr);
115extern int stVectors(unsigned int *addr);
116extern int stSpecrs(unsigned int *addr);
117extern unsigned int LLTraceSet(unsigned int tflags);
118extern void GratefulDebInit(bootBumbleC *boot_video_info);
119extern void GratefulDebDisp(unsigned int coord, unsigned int data);
120extern void checkNMI(void);
121
122typedef struct GDWorkArea { /* Grateful Deb work area one per processor */
123
124/* Note that a lot of info is duplicated for each processor */
125
126 unsigned int GDsave[32]; /* Save area for registers */
127
128 unsigned int GDfp0[2];
129 unsigned int GDfp1[2];
130 unsigned int GDfp2[2];
131 unsigned int GDfp3[2];
132
133 unsigned int GDtop; /* Top pixel of CPU's window */
134 unsigned int GDleft; /* Left pixel of CPU's window */
135 unsigned int GDtopleft; /* Physical address of top left in frame buffer */
136 unsigned int GDrowbytes; /* Bytes per row */
137 unsigned int GDrowchar; /* Bytes per row of characters plus leading */
138 unsigned int GDdepth; /* Bits per pixel */
139 unsigned int GDcollgn; /* Column width in bytes */
140 unsigned int GDready; /* We are ready to go */
141 unsigned int GDfiller[16]; /* Fill it up to a 256 byte boundary */
142
143 unsigned int GDrowbuf1[128]; /* Buffer to an 8 character row */
144 unsigned int GDrowbuf2[128]; /* Buffer to an 8 character row */
145
146} GDWorkArea;
147#define GDfontsize 16
148#define GDdispcols 2
149
150#endif /* _FIRMWARE_H_ */