]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
de355530 A |
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. | |
1c79356b | 11 | * |
de355530 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
de355530 A |
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. | |
1c79356b A |
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 | ||
46 | void dbgDisp(unsigned int port, unsigned int id, unsigned int data); | |
47 | void dbgLog(unsigned int d0, unsigned int d1, unsigned int d2, unsigned int d3); | |
48 | void dbgLog2(unsigned int type, unsigned int p1, unsigned int p2); | |
49 | void dbgDispLL(unsigned int port, unsigned int id, unsigned int data); | |
50 | void fwSCCinit(unsigned int port); | |
51 | ||
de355530 | 52 | extern void dbgTrace(unsigned int item1, unsigned int item2, unsigned int item3); |
1c79356b | 53 | #if 0 /* (TEST/DEBUG) - eliminate inline */ |
de355530 | 54 | extern __inline__ void dbgTrace(unsigned int item1, unsigned int item2, unsigned int item3) { |
1c79356b A |
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 | ||
66 | extern void DoPreempt(void); | |
67 | extern __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 | ||
74 | extern void CreateFakeIO(void); | |
75 | extern __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 | ||
82 | extern void CreateFakeDEC(void); | |
83 | extern __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 | ||
90 | extern void CreateShutdownCTX(void); | |
91 | extern __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 | ||
0b4e3aa0 A |
98 | extern void ChokeSys(unsigned int ercd); |
99 | extern __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 | ||
1c79356b A |
107 | typedef struct Boot_Video bootBumbleC; |
108 | ||
109 | extern void StoreReal(unsigned int val, unsigned int addr); | |
de355530 | 110 | extern void ReadReal(unsigned int raddr, unsigned int *vaddr); |
1c79356b A |
111 | extern void ClearReal(unsigned int addr, unsigned int lgn); |
112 | extern void LoadDBATs(unsigned int *bat); | |
113 | extern void LoadIBATs(unsigned int *bat); | |
114 | extern void stFloat(unsigned int *addr); | |
115 | extern int stVectors(unsigned int *addr); | |
116 | extern int stSpecrs(unsigned int *addr); | |
117 | extern unsigned int LLTraceSet(unsigned int tflags); | |
118 | extern void GratefulDebInit(bootBumbleC *boot_video_info); | |
119 | extern void GratefulDebDisp(unsigned int coord, unsigned int data); | |
120 | extern void checkNMI(void); | |
121 | ||
122 | typedef 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_ */ |