]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ppc/Firmware.h
xnu-124.1.tar.gz
[apple/xnu.git] / osfmk / ppc / Firmware.h
CommitLineData
1c79356b
A
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
98typedef struct Boot_Video bootBumbleC;
99
100extern void StoreReal(unsigned int val, unsigned int addr);
101extern void ReadReal(unsigned int raddr, unsigned int *vaddr);
102extern void ClearReal(unsigned int addr, unsigned int lgn);
103extern void LoadDBATs(unsigned int *bat);
104extern void LoadIBATs(unsigned int *bat);
105extern void stFloat(unsigned int *addr);
106extern int stVectors(unsigned int *addr);
107extern int stSpecrs(unsigned int *addr);
108extern unsigned int LLTraceSet(unsigned int tflags);
109extern void GratefulDebInit(bootBumbleC *boot_video_info);
110extern void GratefulDebDisp(unsigned int coord, unsigned int data);
111extern void checkNMI(void);
112
113typedef struct GDWorkArea { /* Grateful Deb work area one per processor */
114
115/* Note that a lot of info is duplicated for each processor */
116
117 unsigned int GDsave[32]; /* Save area for registers */
118
119 unsigned int GDfp0[2];
120 unsigned int GDfp1[2];
121 unsigned int GDfp2[2];
122 unsigned int GDfp3[2];
123
124 unsigned int GDtop; /* Top pixel of CPU's window */
125 unsigned int GDleft; /* Left pixel of CPU's window */
126 unsigned int GDtopleft; /* Physical address of top left in frame buffer */
127 unsigned int GDrowbytes; /* Bytes per row */
128 unsigned int GDrowchar; /* Bytes per row of characters plus leading */
129 unsigned int GDdepth; /* Bits per pixel */
130 unsigned int GDcollgn; /* Column width in bytes */
131 unsigned int GDready; /* We are ready to go */
132 unsigned int GDfiller[16]; /* Fill it up to a 256 byte boundary */
133
134 unsigned int GDrowbuf1[128]; /* Buffer to an 8 character row */
135 unsigned int GDrowbuf2[128]; /* Buffer to an 8 character row */
136
137} GDWorkArea;
138#define GDfontsize 16
139#define GDdispcols 2
140
141#endif /* _FIRMWARE_H_ */