original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
+110
View File
@@ -0,0 +1,110 @@
/* erfLib.h - Event Reporting Framework Library */
/*
* Copyright (c) 2005, 2010, 2017 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01g,05dec17,whu Added extern C statement (VXW6-86542)
01f,29jan10,h_k LP64 adaptation.
01e,24jun05,jmt Allow multiple tasks and auto unregistration
01d,01sep05,mil Fixed build warning on useless keyword/empty declaration.
01c,17may05,jmt Update after Design review
01b,23mar05,jmt Continue implementation after initial review
01a,16mar05,jmt written
*/
/*
DESCRIPTION
This module provides an Event Reporting Framework for use by other
libraries.
INCLUDE FILES: vwModNum.h
*/
#ifndef INCerfLibh
#define INCerfLibh
#include <vwModNum.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
/* erfHandlerRaise "procType" defines */
#define ERF_ASYNC_PROC 0 /* Asynchronous (delayed) proc */
#define ERF_SYNC_PROC 1 /* Synchronous (immediate) proc */
#define ERF_PROC_TYPE_MAX ERF_SYNC_PROC /* for range checking */
/* erfHandlerRegister Event Processing flags Defines */
#define ERF_FLAG_NONE 0 /* No options needed */
#define ERF_FLAG_AUTO_UNREG 1 /* Auto Unregister after event */
#define ERF_FLAG_MAX ERF_FLAG_AUTO_UNREG /* for range checking */
/* Event Category and Type Defines */
#define ERF_NUM_SYSTEM_CATEGORIES 1
#define ERF_MAX_NUM_SYSTEM_TYPES 3 /* must include T_erfLib_ALL_TYPES */
/* Globally defined Types */
#define T_erfLib_ALL_TYPES 0
/* Test Event Category and related types */
#define C_erfLib_TEST_CATEGORY 0
#define T_erfLib_TEST_0_TYPE 1
#define T_erfLib_TEST_1_TYPE 2
/* errno defines */
#define S_erfLib_INVALID_PARAMETER (M_erfLib | 0x0001)
#define S_erfLib_MEMORY_ERROR (M_erfLib | 0x0002)
#define S_erfLib_INIT_ERROR (M_erfLib | 0x0003)
#define S_erfLib_TOO_MANY_USER_CATS (M_erfLib | 0x0004)
#define S_erfLib_TOO_MANY_USER_TYPES (M_erfLib | 0x0005)
#define S_erfLib_HANDLER_NOT_FOUND (M_erfLib | 0x0006)
#define S_erfLib_QUEUE_EMPTY (M_erfLib | 0x0007)
#define S_erfLib_QUEUE_FULL (M_erfLib | 0x0008)
#define S_erfLib_QUEUE_ALREADY_CREATED (M_erfLib | 0x0009)
#define S_erfLib_AUTO_UNREG_ERROR (M_erfLib | 0x000A)
/* typedefs */
typedef void erfHandlerPrototype (UINT16 maxUserCat, UINT16 maxUserType,
void * pEventData, void * pUserData);
typedef void erfFreePrototype (void * __ptr);
/* forward declarations */
STATUS erfLibInit (UINT16 maxUserCat, UINT16 maxUserType);
UINT16 erfMaxCategoriesGet(void);
UINT16 erfMaxTypesGet(void);
UINT16 erfQueueSizeGet(void);
STATUS erfHandlerRegister(UINT16 eventCat, UINT16 eventType,
erfHandlerPrototype * pEventHandler,
void * pUserData, UINT16 flags);
STATUS erfHandlerUnregister(UINT16 eventCat, UINT16 eventType,
erfHandlerPrototype * pEventHandler,
void * pUserData);
STATUS erfCategoryAllocate(UINT16 * pEventCat);
STATUS erfCategoryQueueCreate(UINT16 pEventCat, size_t queueSize, int priority);
STATUS erfTypeAllocate(UINT16 eventCat, UINT16 * pEventType);
UINT16 erfCategoriesAvailable(void);
UINT16 erfTypesAvailable(UINT16 eventCat);
STATUS erfEventRaise(UINT16 eventCat, UINT16 eventType, int procType,
void * pEventData, erfFreePrototype * pFreeFunc);
#ifdef __cplusplus
}
#endif
#endif /* INCerfLibh */
+78
View File
@@ -0,0 +1,78 @@
/* erfLibP.h - Event Reporting Framework Library Private header */
/*
* Copyright (c) 2005, 2010, 2017 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01c,05dec17,whu Added extern C statement (VXW6-86542)
01b,29jan10,h_k LP64 adaptation.
01a,27jun05,jmt written
*/
/*
DESCRIPTION
This file provides the private definitions for the Event Reporting Framework.
INCLUDE FILES: erfLib.h
*/
#ifndef INCerfLibPh
#define INCerfLibPh
#include "erfLib.h"
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define ERF_EVENT_QUEUE_ERROR ((struct erfQueueStruct *)(-1))
/* typedefs */
struct eventHandlerStruct /* Event Handler Info */
{
UINT16 flags; /* processing flags */
erfHandlerPrototype * pHandler; /* handler function */
void * pUserData; /* User Data Pointer */
struct eventHandlerStruct * next; /* next in list */
};
struct erfQueueElementStruct
{
UINT16 eventCat; /* Event Category */
UINT16 eventType; /* Event Type */
void * pEventData; /* Pointer to Event Data */
erfFreePrototype * pFreeFunc; /* Func to free Event Data when done */
};
struct erfQueueStruct
{
UINT16 queueSize; /* number of elements */
UINT16 firstElement; /* index number of first element */
UINT16 firstFreeElement; /* index number of last element */
SEM_ID queueCount; /* Counting semaphore for handling elements */
TASK_ID eventTaskId; /* Event Task ID */
struct erfQueueElementStruct data[1]; /* List of Event Records */
};
/* forward declarations */
UINT16 erfMaxCategoriesGet (void);
UINT16 erfMaxTypesGet (void);
UINT16 erfQueueSizeGet (void);
#ifdef __cplusplus
}
#endif
#endif /* INCerfLibPh */
+49
View File
@@ -0,0 +1,49 @@
/* erfShow.h - Event Reporting Framework Library Show routines header */
/*
* Copyright (c) 2005, 2010, 2017 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01d,05dec17,whu Added extern C statement (VXW6-86542)
01c,29jan10,h_k cleaned up compiler warnings in LP64.
01b,22jul05,jmt Allow multiple tasks and auto unregistration
01a,30mar05,jmt written
*/
/*
DESCRIPTION
This module provides an Event Reporting Framework Show and debug routines.
INCLUDE FILES:
*/
#ifndef INCerfShowh
#define INCerfShowh
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
/* typedefs */
/* forward declarations */
void erfShow (void);
UINT16 erfMaxCategoriesGet (void);
UINT16 erfMaxTypesGet (void);
UINT16 erfDefaultQueueSizeGet (void);
#ifdef __cplusplus
}
#endif
#endif /* INCerfShowh */