Annotation of XNU/osfmk/ppc/Firmware.h, revision 1.1.1.1

1.1       root        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: 
                     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: 
                     52: extern void dbgTrace(unsigned int item1, unsigned int item2, unsigned int item3);
                     53: #if 0          /* (TEST/DEBUG) - eliminate inline */
                     54: extern __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: #ifdef __ELF__
                     60:         __asm__ volatile("lis  r0,CutTrace@h" : : : "r0");
                     61:         __asm__ volatile("ori  r0,r0,CutTrace@l" : : : "r0");
                     62: #else
                     63:         __asm__ volatile("lis  r0,hi16(CutTrace)" : : : "r0");
                     64:         __asm__ volatile("ori  r0,r0,lo16(CutTrace)" : : : "r0");
                     65: #endif
                     66:         __asm__ volatile("sc");
                     67:                return;
                     68: }
                     69: #endif
                     70: 
                     71: extern void DoPreempt(void);
                     72: extern __inline__ void DoPreempt(void) {
                     73: #ifdef __ELF__
                     74:         __asm__ volatile("lis  r0,DoPreemptCall@h" : : : "r0");
                     75:         __asm__ volatile("ori  r0,r0,DoPreemptCall@l" : : : "r0");
                     76: #else
                     77:         __asm__ volatile("lis  r0,hi16(DoPreemptCall)" : : : "r0");
                     78:         __asm__ volatile("ori  r0,r0,lo16(DoPreemptCall)" : : : "r0");
                     79: #endif
                     80:         __asm__ volatile("sc");
                     81:                return;
                     82: }
                     83: 
                     84: extern void CreateFakeIO(void);
                     85: extern __inline__ void CreateFakeIO(void) {
                     86: #ifdef __ELF__
                     87:         __asm__ volatile("lis  r0,CreateFakeIOCall@h" : : : "r0");
                     88:         __asm__ volatile("ori  r0,r0,CreateFakeIOCall@l" : : : "r0");
                     89: #else
                     90:         __asm__ volatile("lis  r0,hi16(CreateFakeIOCall)" : : : "r0");
                     91:         __asm__ volatile("ori  r0,r0,lo16(CreateFakeIOCall)" : : : "r0");
                     92: #endif
                     93:          __asm__ volatile("sc");
                     94:                return;
                     95: }
                     96: 
                     97: extern void CreateFakeDEC(void);
                     98: extern __inline__ void CreateFakeDEC(void) {
                     99: #ifdef __ELF__
                    100:         __asm__ volatile("lis  r0,CreateFakeDECCall@h" : : : "r0");
                    101:         __asm__ volatile("ori  r0,r0,CreateFakeDECCall@l" : : : "r0");
                    102: #else
                    103:         __asm__ volatile("lis  r0,hi16(CreateFakeDECCall)" : : : "r0");
                    104:         __asm__ volatile("ori  r0,r0,lo16(CreateFakeDECCall)" : : : "r0");
                    105: #endif
                    106:          __asm__ volatile("sc");
                    107:                return;
                    108: }
                    109: 
                    110: typedef struct Boot_Video bootBumbleC;
                    111: 
                    112: extern void StoreReal(unsigned int val, unsigned int addr);
                    113: extern void ReadReal(unsigned int raddr, unsigned int *vaddr);
                    114: extern void ClearReal(unsigned int addr, unsigned int lgn);
                    115: extern void LoadDBATs(unsigned int *bat);
                    116: extern void LoadIBATs(unsigned int *bat);
                    117: extern void stFloat(unsigned int *addr);
                    118: extern int stVectors(unsigned int *addr);
                    119: extern int stSpecrs(unsigned int *addr);
                    120: extern unsigned int LLTraceSet(unsigned int tflags);
                    121: extern void GratefulDebInit(bootBumbleC *boot_video_info);
                    122: extern void GratefulDebDisp(unsigned int coord, unsigned int data);
                    123: extern void checkNMI(void);
                    124: 
                    125: typedef struct GDWorkArea {                    /* Grateful Deb work area one per processor */
                    126: 
                    127: /*     Note that a lot of info is duplicated for each processor */
                    128: 
                    129:        unsigned int GDsave[32];                /* Save area for registers */
                    130:        
                    131:        unsigned int GDfp0[2];
                    132:        unsigned int GDfp1[2];
                    133:        unsigned int GDfp2[2];
                    134:        unsigned int GDfp3[2];
                    135:        
                    136:        unsigned int GDtop;                             /* Top pixel of CPU's window */
                    137:        unsigned int GDleft;                    /* Left pixel of CPU's window */
                    138:        unsigned int GDtopleft;                 /* Physical address of top left in frame buffer */
                    139:        unsigned int GDrowbytes;                /* Bytes per row */
                    140:        unsigned int GDrowchar;                 /* Bytes per row of characters plus leading */
                    141:        unsigned int GDdepth;                   /* Bits per pixel */
                    142:        unsigned int GDcollgn;                  /* Column width in bytes */
                    143:        unsigned int GDready;                   /* We are ready to go */
                    144:        unsigned int GDfiller[16];              /* Fill it up to a 256 byte boundary */
                    145:        
                    146:        unsigned int GDrowbuf1[128];    /* Buffer to an 8 character row */
                    147:        unsigned int GDrowbuf2[128];    /* Buffer to an 8 character row */
                    148: 
                    149: } GDWorkArea;
                    150: #define GDfontsize 16
                    151: #define GDdispcols 2
                    152: 
                    153: #endif /* _FIRMWARE_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.