summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_pore_api_custom.h
blob: a35fb10067ffe20e6ac1348c73f10da712e5ce0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*  IBM_PROLOG_BEGIN_TAG
 *  This is an automatically generated prolog.
 *
 *  $Source: src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_pore_api_custom.h $
 *
 *  IBM CONFIDENTIAL
 *
 *  COPYRIGHT International Business Machines Corp. 2012
 *
 *  p1
 *
 *  Object Code Only (OCO) source materials
 *  Licensed Internal Code Source Materials
 *  IBM HostBoot Licensed Internal Code
 *
 *  The source code for this program is not published or other-
 *  wise divested of its trade secrets, irrespective of what has
 *  been deposited with the U.S. Copyright Office.
 *
 *  Origin: 30
 *
 *  IBM_PROLOG_END_TAG
 */
/* $Id: p8_pore_api_custom.h,v 1.5 2012/05/22 21:25:21 cmolsen Exp $ */
/* $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/utils/p8_pore_api_custom.h,v $ */

#include <stdint.h> /* for uint32_t */
#include <stdio.h> /* for printf */
#ifndef __HOSTBOOT_MODULE
#include <netinet/in.h> /* for htonl */
#endif

/**
  * This file should be modified by users to appropriately handle some
  * environment-specific operations.
  */


/*********************************/
/*****  Logging and Tracing  *****/
/*********************************/
/**
 * All tracing functions assume printf-style formatting
 */

#ifndef __FAPI
/* Trace an informational message */
#define P8_PORE_ITRACE0(msg) printf("PORE> INFO: " msg "\n");
#define P8_PORE_ITRACE1(msg, arg0) printf("PORE> INFO: " msg "\n", arg0);

/* Trace an error message */
#define P8_PORE_ETRACE0(msg) printf("PORE> ERROR: " msg "\n");
#define P8_PORE_ETRACE1(msg, arg0) printf("PORE> ERROR: " msg "\n", arg0);
#define P8_PORE_ETRACE2(msg, arg0, arg1) printf("PORE> ERROR: " msg "\n", arg0, arg1);
#define P8_PORE_ETRACE3(msg, arg0, arg1, arg2) printf("PORE> ERROR: " msg "\n", arg0, arg1, arg2);
#define P8_PORE_ETRACE4(msg, arg0, arg1, arg2, arg3) printf("PORE> ERROR: " msg "\n", arg0, arg1, arg2, arg3);
#define P8_PORE_ETRACE5(msg, arg0, arg1, arg2, arg3, arg4) printf("PORE> ERROR: " msg "\n", arg0, arg1, arg2, arg3, arg4);
#endif
/* Used for debug, Cronus/FW should leave these empty */
#define P8_PORE_DTRACE0(msg)
#define P8_PORE_DTRACE1(msg, arg0) 
#define P8_PORE_DTRACE2(msg, arg0, arg1) 
#define P8_PORE_DTRACE3(msg, arg0, arg1, arg2) 
#define P8_PORE_DTRACE4(msg, arg0, arg1, arg2, arg3) 

/****** Following is only used for debug purposes ******/
/* FW/Cronus should NOT include this section */
/* DTRACE - Print debug statements to command line */
/* FTRACE - Print text PORE instructions of cpureg setup to DEBUG_FILE */
/*
#define P8_PORE_DTRACE0(msg) printf("PORE> DEBUG: " msg "\n");
#define P8_PORE_DTRACE1(msg, arg0) printf("PORE> DEBUG: " msg "\n", arg0);
#define P8_PORE_DTRACE2(msg, arg0, arg1) printf("PORE> DEBUG: " msg "\n", arg0, arg1);
#define P8_PORE_DTRACE3(msg, arg0, arg1, arg2) printf("PORE> DEBUG: " msg "\n", arg0, arg1, arg2);
#define P8_PORE_DTRACE4(msg, arg0, arg1, arg2, arg3) printf("PORE> DEBUG: " msg "\n", arg0, arg1, arg2, arg3);
*/

/**********************************/
/*****  Endian-ness Handling  *****/
/**********************************/
/**
 * Handle byte-swapping if necessary
 */

/* Default to big-endian format on both sides */
#define P8_PORE_HOST_TO_BIG32( bit32_int )  htonl(bit32_int)
#define P8_PORE_BIG32_TO_HOST( bit32_int )  ntohl(bit32_int)
#define P8_PORE_HOST_TO_BIG16( bit16_int )  htonl(bit16_int)
#define P8_PORE_BIG16_TO_HOST( bit16_int )  ntohl(bit16_int)

/*
*************** Do not edit this area ***************
This section is automatically updated by CVS when you check in this file.
Be sure to create CVS comments when you commit so that they can be included here.

$Log: p8_pore_api_custom.h,v $
Revision 1.5  2012/05/22 21:25:21  cmolsen
Updated to remove FAPI tracing, which is not allowed in plain C files.

Revision 1.4  2012/05/21 14:45:41  cmolsen
Updated to address Gerrit review II comments about printf() usage.

Revision 1.3  2012/05/15 19:53:38  cmolsen
Updated to address Gerrit review comments:
- Hostboot doesn't support printf().

Revision 1.2  2012/04/13 16:45:32  cmolsen
Includes __HOSTBOOT_MODULE exclude of <netinit/in.h>

Revision 1.1  2011/08/25 12:28:38  yjkim
initial check in

Revision 1.10  2010/08/30 23:27:17  schwartz
Added TRACE statements to include specified number of arguments
Defined branch type constants
Added constant for last scom op used to check if operation input to gen_scan is valid
Added mult spr error constant
Added p7p_pore_gen_wait API
Changed additional C++ style comments to C style
Initialized all variables to 0
Removed FTRACE statements
Added additional information to trace statements
Updated gen_scom to use the defined operation constants
Updated branch gen_relbranch to use defined branch type constants
Added rc check for calls to p7p_pore_gen_cpureg_status and p7p_pore_span_128byte_boundary subroutines

Revision 1.9  2010/08/30 14:57:54  schwartz
Removed FTRACE and associated #define statements
Changed TRACE macros to multiple macros with specified number of args

Revision 1.6  2010/08/26 15:13:34  schwartz
Fixed more C++ style comments to C style comments

Revision 1.5  2010/06/23 23:06:37  schwartz
Defined additional trace functions to be used for debugging, not in FW or Cronus

Revision 1.4  2010/05/24 02:34:07  schwartz
Fixed errors that appear when using -Werrors flag
Added in cvs logging (hopefully)


*/
OpenPOWER on IntegriCloud