1 #ifndef _ISERIES_FLIGHTRECORDER_H
2 #define _ISERIES_FLIGHTRECORDER_H
3 /************************************************************************/
4 /* File iSeries_FlightRecorder.h created by Allan Trautman Jan 22 2001. */
5 /************************************************************************/
6 /* This code supports the pci interface on the IBM iSeries systems. */
7 /* Copyright (C) 20yy <Allan H Trautman> <IBM Corp> */
9 /* This program is free software; you can redistribute it and/or modify */
10 /* it under the terms of the GNU General Public License as published by */
11 /* the Free Software Foundation; either version 2 of the License, or */
12 /* (at your option) any later version. */
14 /* This program is distributed in the hope that it will be useful, */
15 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
16 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
17 /* GNU General Public License for more details. */
19 /* You should have received a copy of the GNU General Public License */
20 /* along with this program; if not, write to the: */
21 /* Free Software Foundation, Inc., */
22 /* 59 Temple Place, Suite 330, */
23 /* Boston, MA 02111-1307 USA */
24 /************************************************************************/
25 /* Change Activity: */
26 /* Created, Jan 22, 2001 */
27 /* Added Time stamp methods. Apr 12, 2001 */
28 /* End Change Activity */
29 /************************************************************************/
30 /* This is a generic Flight Recorder, simply stuffs line entries into a */
31 /* buffer for debug purposes. */
34 /* 1. Create one, make it global so it isn't on the stack. */
35 /* FlightRecorder PciFlightRecorder; */
37 /* 2. Optionally create a pointer to it, just makes it easier to use. */
38 /* FlightRecorder* PciFr = &PciFlightRecorder; */
40 /* 3. Initialize with you signature. */
41 /* iSeries_Fr_Initialize(PciFr, "Pci Flight Recorder"); */
44 /* PciFr->logEntry(PciFr,"In Main"); */
46 /* 5. Later, you can find the Flight Recorder by looking in the */
48 /************************************************************************/
49 struct iSeries_FlightRecorder; /* Forward declares */
51 void logEntry(struct iSeries_FlightRecorder*, char* Text);
52 void logTime( struct iSeries_FlightRecorder*, char* Text);
53 void logDate( struct iSeries_FlightRecorder*, char* Text);
54 #define FlightRecorderSize 4096
56 /************************************************************************/
57 /* Generic Flight Recorder Structure */
58 /************************************************************************/
59 struct iSeries_FlightRecorder { /* Structure Defination */
60 char Signature[16]; /* Eye Catcher */
61 char* StartingPointer; /* Buffer Starting Address */
62 char* CurrentPointer; /* Next Entry Address */
63 int WrapCount; /* Number of Buffer Wraps */
64 void (*logEntry)(struct iSeries_FlightRecorder*,char*);
65 void (*logTime) (struct iSeries_FlightRecorder*,char*);
66 void (*logDate) (struct iSeries_FlightRecorder*,char*);
67 char Buffer[FlightRecorderSize];
70 typedef struct iSeries_FlightRecorder FlightRecorder; /* Short Name */
71 extern void iSeries_Fr_Initialize(FlightRecorder*, char* Signature);
72 /************************************************************************/
73 /* extern void iSeries_LogFr_Entry( FlightRecorder*, char* Text); */
74 /* extern void iSeries_LogFr_Date( FlightRecorder*, char* Text); */
75 /* extern void iSeries_LogFr_Time( FlightRecorder*, char* Text); */
76 /************************************************************************/
77 /* PCI Flight Recorder Helpers */
78 /************************************************************************/
79 extern FlightRecorder* PciFr; /* Ptr to Pci Fr */
80 extern char* PciFrBuffer; /* Ptr to Fr Work Buffer */
81 #define ISERIES_PCI_FR(buffer) PciFr->logEntry(PciFr,buffer);
82 #define ISERIES_PCI_FR_TIME(buffer) PciFr->logTime(PciFr,buffer);
83 #define ISERIES_PCI_FR_DATE(buffer) PciFr->logDate(PciFr,buffer);
85 #endif /* _ISERIES_FLIGHTRECORDER_H */