From ed023e4eb60989a43b1e1e672dd77d84d3a543b3 Mon Sep 17 00:00:00 2001 From: Thi Tran Date: Thu, 12 May 2011 12:51:31 -0500 Subject: Initial Error Log code delivery Merge src/usr/makefile conflict Update after first review Update after 2nd review. Add error creation example Update example with review comments Re-arrange parameters' order of error log constructor Update with additional comments from Patrick Change-Id: I18001f6232492a3acfd8819b34ef670a785ac483 Reviewed-on: http://gfwr801.rchland.ibm.com:8080/gerrit/72 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III Reviewed-by: Andrew J. Geissler --- src/include/usr/example/example.H | 9 +++++++++ src/include/usr/example/examplerc.H | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/include/usr/example/examplerc.H (limited to 'src/include/usr/example') diff --git a/src/include/usr/example/example.H b/src/include/usr/example/example.H index 1444893b2..b22c38da2 100644 --- a/src/include/usr/example/example.H +++ b/src/include/usr/example/example.H @@ -15,4 +15,13 @@ */ uint64_t example1_function(); +/** + * @brief Example of creating an error log function + * + * @return void + * + */ +void example2_create_errorlog_function(); + + #endif diff --git a/src/include/usr/example/examplerc.H b/src/include/usr/example/examplerc.H new file mode 100644 index 000000000..9e65d3515 --- /dev/null +++ b/src/include/usr/example/examplerc.H @@ -0,0 +1,33 @@ +// This file is an example how you create a reason code to pass in an +// error log creation + +#ifndef __EXAMPLE_RC_H +#define __EXAMPLE_RC_H + +#include + +// The definitions in this file is an example that shows how to define +// reason codes. Each Host Boot component should have a service code +// file (servicecodes.H) that defines its module IDs and +// unique reason codes. +// See errlservicecodes.H for example of this file for ERRL component. + +// Below is an example of defining reason codes +enum myModuleId +{ + MY_MODULE_ID_1 = 0x00, + //........ + MY_LAST_MODULE_ID = 0xFF +}; + +// This enum definition should be in an .H file in your component area. +// MY_COMPONENT_ID is your component name defined in hbotcompid.H file +// included above. +enum myReasonCode +{ + MY_REASON_CODE_1 = MY_COMP_ID | 0x01, + //........ + ERRL_LAST_REASON_CODE = MY_COMP_ID | 0xFF +}; + +#endif -- cgit v1.2.1