osaf/libs/common/mqsv/include/mqsv.h | 1 - osaf/libs/core/leap/hj_edp.c | 53 +++--- osaf/libs/core/leap/hj_edu.c | 29 +- osaf/libs/core/leap/include/Makefile.am | 1 - osaf/libs/core/leap/include/sysf_def.h | 274 ---------------------------------- osaf/libs/core/leap/sysf_def.c | 1 - osaf/libs/core/leap/sysf_mem.c | 1 - osaf/libs/core/leap/sysf_tmr.c | 1 - 8 files changed, 40 insertions(+), 321 deletions(-)
diff --git a/osaf/libs/common/mqsv/include/mqsv.h b/osaf/libs/common/mqsv/include/mqsv.h --- a/osaf/libs/common/mqsv/include/mqsv.h +++ b/osaf/libs/common/mqsv/include/mqsv.h @@ -72,7 +72,6 @@ #include "stdlib.h" /* From /leap/os_svcs/leap_basic/inc */ -#include "sysf_def.h" #include "mqsv_common.h" #include "ncs_util.h" diff --git a/osaf/libs/core/leap/hj_edp.c b/osaf/libs/core/leap/hj_edp.c --- a/osaf/libs/core/leap/hj_edp.c +++ b/osaf/libs/core/leap/hj_edp.c @@ -32,7 +32,6 @@ #include "ncssysf_mem.h" #include "ncsencdec_pub.h" #include "ncs_edu.h" -#include "sysf_def.h" #include "ncs_ubaid.h" extern char gl_log_string[]; @@ -80,7 +79,7 @@ uint32_t ncs_edp_ncs_bool(EDU_HDL *hdl, if (*(bool **)ptr == NULL) { /* Since "ncs_edp_ncs_bool" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(bool **)ptr) = uptr = m_MMGR_ALLOC_EDP_bool; + (*(bool **)ptr) = uptr = (bool *)malloc(sizeof(bool)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -114,7 +113,7 @@ uint32_t ncs_edp_ncs_bool(EDU_HDL *hdl, /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_bool; + uptr = (bool*)malloc(sizeof(bool)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -222,7 +221,7 @@ uint32_t ncs_edp_uns8(EDU_HDL *hdl, EDU_ if (*(uint8_t **)ptr == NULL) { /* Since "ncs_edp_uns8" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(uint8_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_UNS8(len); + (*(uint8_t **)ptr) = uptr = malloc((len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -278,7 +277,7 @@ uint32_t ncs_edp_uns8(EDU_HDL *hdl, EDU_ len |= (uint16_t)*(p8)++; } - uptr = m_MMGR_ALLOC_EDP_UNS8(len); + uptr = malloc((len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -395,7 +394,7 @@ uint32_t ncs_edp_uns16(EDU_HDL *hdl, EDU if (*(uint16_t **)ptr == NULL) { /* Since "ncs_edp_uns16" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(uint16_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(uint16_t) * len); + (*(uint16_t **)ptr) = uptr = malloc((sizeof(uint16_t) * len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -444,7 +443,7 @@ uint32_t ncs_edp_uns16(EDU_HDL *hdl, EDU len |= (uint16_t)*(p8)++; } - uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(uint16_t) * len); + uptr = malloc((sizeof(uint16_t) * len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -550,7 +549,7 @@ uint32_t ncs_edp_uns32(EDU_HDL *hdl, EDU if (*(uint32_t **)ptr == NULL) { /* Since "ncs_edp_uns32" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(uint32_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_UNS8(4 * len); + (*(uint32_t **)ptr) = uptr = malloc((4 * len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -596,7 +595,7 @@ uint32_t ncs_edp_uns32(EDU_HDL *hdl, EDU len = ((uint16_t)*(p8)++) << 8; len |= (uint16_t)*(p8)++; } - uptr = m_MMGR_ALLOC_EDP_UNS8(4 * len); + uptr = malloc((4 * len)*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -685,7 +684,7 @@ uint32_t ncs_edp_char(EDU_HDL *hdl, EDU_ if (*(uint8_t **)ptr == NULL) { /* Since "ncs_edp_char" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(char **)ptr) = uptr = m_MMGR_ALLOC_EDP_CHAR(*ptr_data_len); + (*(char **)ptr) = uptr = malloc((*ptr_data_len)*sizeof(char)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -719,7 +718,7 @@ uint32_t ncs_edp_char(EDU_HDL *hdl, EDU_ char *uptr = NULL; *ptr_data_len = 1; - uptr = m_MMGR_ALLOC_EDP_CHAR(*ptr_data_len); + uptr = malloc((*ptr_data_len)*sizeof(char)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -838,7 +837,7 @@ uint32_t ncs_edp_string(EDU_HDL *hdl, ED if (*(char **)ptr == NULL) { /* Since "ncs_edp_string" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(char **)ptr) = uptr = m_MMGR_ALLOC_EDP_CHAR(len + 1); + (*(char **)ptr) = uptr = malloc((len + 1)*sizeof(char)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -899,7 +898,7 @@ uint32_t ncs_edp_string(EDU_HDL *hdl, ED if (len != 0) { char *uptr = NULL; - uptr = m_MMGR_ALLOC_EDP_CHAR(len + 1); + uptr = malloc((len + 1)sizeof(char)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -985,7 +984,7 @@ uint32_t ncs_edp_short(EDU_HDL *hdl, EDU if (*(short **)ptr == NULL) { /* Since "ncs_edp_short" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(short **)ptr) = uptr = m_MMGR_ALLOC_EDP_SHORT; + (*(short **)ptr) = uptr = (short *)malloc(sizeof(short)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1021,7 +1020,7 @@ uint32_t ncs_edp_short(EDU_HDL *hdl, EDU /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_SHORT; + uptr = (short *)malloc(sizeof(short)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1102,7 +1101,7 @@ uint32_t ncs_edp_int(EDU_HDL *hdl, EDU_T if (*(int **)ptr == NULL) { /* Since "ncs_edp_int" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(int **)ptr) = uptr = m_MMGR_ALLOC_EDP_INT; + (*(int **)ptr) = uptr = (int *)malloc(sizeof(int)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1138,7 +1137,7 @@ uint32_t ncs_edp_int(EDU_HDL *hdl, EDU_T /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_INT; + uptr = (int *)malloc(sizeof(int)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1215,7 +1214,7 @@ uint32_t ncs_edp_int8(EDU_HDL *hdl, EDU_ int8_t *uptr = NULL; if (*(int8_t **)ptr == NULL) { - (*(int8_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_INT8; + (*(int8_t **)ptr) = uptr = (int8_t *)malloc(sizeof(int8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1251,7 +1250,7 @@ uint32_t ncs_edp_int8(EDU_HDL *hdl, EDU_ /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_INT8; + uptr = (int8_t*)malloc(sizeof(int8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1329,7 +1328,7 @@ uint32_t ncs_edp_int16(EDU_HDL *hdl, EDU int16_t *uptr = NULL; if (*(int16_t **)ptr == NULL) { - (*(int16_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_INT16; + (*(int16_t **)ptr) = uptr = (int16_t *)malloc(sizeof(int16_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1365,7 +1364,7 @@ uint32_t ncs_edp_int16(EDU_HDL *hdl, EDU /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_INT16; + uptr = (int16_t *)malloc(sizeof(int16_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1443,7 +1442,7 @@ uint32_t ncs_edp_int32(EDU_HDL *hdl, EDU int32_t *uptr = NULL; if (*(int32_t **)ptr == NULL) { - (*(int32_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_INT32; + (*(int32_t **)ptr) = uptr = (int32_t *)malloc(sizeof(int32_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1479,7 +1478,7 @@ uint32_t ncs_edp_int32(EDU_HDL *hdl, EDU /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_INT32; + uptr = (int32_t *)malloc(sizeof(int32_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1659,7 +1658,7 @@ uint32_t ncs_edp_uns64(EDU_HDL *hdl, EDU if (*(uint64_t **)ptr == NULL) { /* Since "uns64" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(uint64_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(uint64_t) / sizeof(uint8_t)); + (*(uint64_t **)ptr) = uptr = malloc((sizeof(uint64_t) / sizeof(uint8_t))*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1699,7 +1698,7 @@ uint32_t ncs_edp_uns64(EDU_HDL *hdl, EDU /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(uint64_t) / sizeof(uint8_t)); + uptr = malloc((sizeof(uint64_t) / sizeof(uint8_t))*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1811,7 +1810,7 @@ uint32_t ncs_edp_int64(EDU_HDL *hdl, EDU if (*(int64_t **)ptr == NULL) { /* Since "int64" is the responsibility of LEAP, LEAP is supposed to malloc this memory. */ - (*(int64_t **)ptr) = uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(int64_t) / sizeof(uint8_t)); + (*(int64_t **)ptr) = uptr = malloc((sizeof(int64_t) / sizeof(uint8_t))*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; @@ -1851,7 +1850,7 @@ uint32_t ncs_edp_int64(EDU_HDL *hdl, EDU /* We need populate the pointer here, so that it can be sent back to the parent invoker(most likely to be able to perform the TEST condition). */ - uptr = m_MMGR_ALLOC_EDP_UNS8(sizeof(int64_t) / sizeof(uint8_t)); + uptr = malloc((sizeof(int64_t) / sizeof(uint8_t))*sizeof(uint8_t)); if (uptr == NULL) { /* Memory failure. */ *o_err = EDU_ERR_MEM_FAIL; diff --git a/osaf/libs/core/leap/hj_edu.c b/osaf/libs/core/leap/hj_edu.c --- a/osaf/libs/core/leap/hj_edu.c +++ b/osaf/libs/core/leap/hj_edu.c @@ -30,7 +30,6 @@ #include "ncs_osprm.h" #include "ncssysf_def.h" #include "ncssysf_mem.h" -#include "sysf_def.h" #include "ncspatricia.h" #include "ncssysfpool.h" #include "ncsencdec_pub.h" @@ -193,7 +192,7 @@ uint32_t ncs_edu_ver_exec(EDU_HDL *edu_h /* Get the variable-arguments of this function into our storage */ int x = 0; - var_array = m_MMGR_ALLOC_EDP_SELECT_ARRAY(var_cnt); + var_array = malloc(var_cnt*sizeof(int)); va_start(arguments, var_cnt); for (x = 0; x < var_cnt; x++) { @@ -250,7 +249,7 @@ uint32_t ncs_edu_ver_exec(EDU_HDL *edu_h #endif if (var_array != NULL) { - m_MMGR_FREE_EDP_SELECT_ARRAY(var_array); + free(var_array); var_array = NULL; } @@ -333,7 +332,7 @@ uint32_t ncs_edu_tlv_exec(EDU_HDL *edu_h /* Get the variable-arguments of this function into our storage */ int x = 0; - var_array = m_MMGR_ALLOC_EDP_SELECT_ARRAY(var_cnt); + var_array = malloc(var_cnt*sizeof(int)); va_start(arguments, var_cnt); for (x = 0; x < var_cnt; x++) { @@ -384,7 +383,7 @@ uint32_t ncs_edu_tlv_exec(EDU_HDL *edu_h #endif if (var_array != NULL) { - m_MMGR_FREE_EDP_SELECT_ARRAY(var_array); + free(var_array); var_array = NULL; } @@ -673,7 +672,7 @@ int ncs_edu_exec_rule(EDU_HDL *edu_hdl, if (--ppdb_node->refcount == 0) { /* Destroy the node. */ edu_ppdb_node_del(&edu_tkn->ppdb, ppdb_node); - m_MMGR_FREE_EDU_PPDB_NODE_INFO(ppdb_node); + free(ppdb_node); } } else #endif @@ -2506,7 +2505,7 @@ uint32_t ncs_edu_validate_and_gen_test_i *o_err = EDU_ERR_EXEC_INSTR_DOES_NOT_EXIST_FOR_OFFSET_OF_TEST_INSTR; return NCSCC_RC_FAILURE; } - if ((tmp = m_MMGR_ALLOC_EDP_TEST_INSTR_REC) == NULL) { + if ((tmp = (EDP_TEST_INSTR_REC *)malloc(sizeof(EDP_TEST_INSTR_REC))) == NULL) { ncs_edu_free_test_instr_rec_list(*head); *head = NULL; *o_err = EDU_ERR_MEM_FAIL; @@ -2554,7 +2553,7 @@ uint32_t ncs_edu_validate_and_gen_test_i } } if (!already_added) { - if ((tmp = m_MMGR_ALLOC_EDP_TEST_INSTR_REC) == NULL) { + if ((tmp = (EDP_TEST_INSTR_REC *)malloc(sizeof(EDP_TEST_INSTR_REC))) == NULL) { ncs_edu_free_test_instr_rec_list(*head); *head = NULL; *o_err = EDU_ERR_MEM_FAIL; @@ -2594,7 +2593,7 @@ void ncs_edu_free_test_instr_rec_list(ED while (head != NULL) { tmp = head->next; - m_MMGR_FREE_EDP_TEST_INSTR_REC(head); + free(head); head = tmp; } @@ -2717,7 +2716,7 @@ static EDU_PPDB_NODE_INFO *edu_ppdb_node ncs_patricia_tree_get(&ppdb->tree, (uint8_t *)&key)) == NULL) { if (add) { /* This is a new one */ - if ((node = (new_node = m_MMGR_ALLOC_EDU_PPDB_NODE_INFO)) == NULL) { + if ((node = (new_node = (EDU_PPDB_NODE_INFO *)malloc(sizeof(EDU_PPDB_NODE_INFO)))) == NULL) { rc = NCSCC_RC_FAILURE; goto done; } @@ -2740,7 +2739,7 @@ static EDU_PPDB_NODE_INFO *edu_ppdb_node if (rc != NCSCC_RC_SUCCESS) { /* If an new entry is created free it. No need of any other cleanup */ if (new_node) - m_MMGR_FREE_EDU_PPDB_NODE_INFO(new_node); + free(new_node); return NULL; } return node; @@ -2773,7 +2772,7 @@ static void edu_ppdb_node_del(EDU_PPDB * } /* Free the node. */ - m_MMGR_FREE_EDU_PPDB_NODE_INFO(node); + free(node); return; } @@ -3247,7 +3246,7 @@ uint32_t ncs_edu_compile_edp(EDU_HDL *ed /* If hdl_node entry not present, add now. */ if ((lcl_hdl_node = (EDU_HDL_NODE *) ncs_patricia_tree_get(&edu_hdl->tree, (uint8_t *)&prog)) == NULL) { - if ((lcl_hdl_node = (new_node = m_MMGR_ALLOC_EDU_HDL_NODE)) == NULL) { + if ((lcl_hdl_node = (new_node = (EDU_HDL_NODE *) malloc(sizeof(EDU_HDL_NODE)))) == NULL) { *o_err = EDU_ERR_MEM_FAIL; return NCSCC_RC_FAILURE; } @@ -3263,7 +3262,7 @@ uint32_t ncs_edu_compile_edp(EDU_HDL *ed /* If an new entry is created free it. No need of any other cleanup */ *o_err = EDU_ERR_MEM_FAIL; if (new_node) - m_MMGR_FREE_EDU_HDL_NODE(new_node); + free(new_node); return NCSCC_RC_FAILURE; } if (hdl_node != NULL) @@ -3366,7 +3365,7 @@ static void edu_hdl_node_del(EDU_HDL *ed node->test_instr_store = NULL; /* Free the node. */ - m_MMGR_FREE_EDU_HDL_NODE(node); + free(node); return; } diff --git a/osaf/libs/core/leap/include/Makefile.am b/osaf/libs/core/leap/include/Makefile.am --- a/osaf/libs/core/leap/include/Makefile.am +++ b/osaf/libs/core/leap/include/Makefile.am @@ -22,7 +22,6 @@ noinst_HEADERS = \ ncsdlib.h \ ncs_edu.h \ ncs_hdl.h \ - sysf_def.h \ sysf_exc_scr.h \ sysf_ipc.h \ usrbuf.h diff --git a/osaf/libs/core/leap/include/sysf_def.h b/osaf/libs/core/leap/include/sysf_def.h deleted file mode 100644 --- a/osaf/libs/core/leap/include/sysf_def.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -*- OpenSAF -*- - * - * (C) Copyright 2008 The OpenSAF Foundation - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed - * under the GNU Lesser General Public License Version 2.1, February 1999. - * The complete license can be accessed from the following location: - * http://opensource.org/licenses/lgpl-license.php - * See the Copying file included with the OpenSAF distribution for full - * licensing terms. - * - * Author(s): Emerson Network Power - * - */ - -/***************************************************************************** -.............................................................................. - -.............................................................................. - - DESCRIPTION: - - This module contains target system specific declarations related to - System "hooks" and other assorted defines. - -.............................................................................. -*/ - -/* - * Module Inclusion Control... - */ -#ifndef SYSF_DEF_H -#define SYSF_DEF_H - -#include "ncssysf_def.h" -#include "ncssysf_mem.h" - -struct ncs_ipaddr_entry; -struct ncsxlim_if_rec; - -#define m_OSSVC_MMGR_ALLOC_NCSIPAE (struct ncs_ipaddr_entry*)m_NCS_MEM_ALLOC(sizeof(struct ncs_ipaddr_entry), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 0) - -#define m_OSSVC_MMGR_FREE_NCSIPAE(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 0) - -#define m_OSSVC_MMGR_ALLOC_NCSXIR (struct ncsxlim_if_rec*)m_NCS_MEM_ALLOC(sizeof(struct ncsxlim_if_rec), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 1) - -#define m_OSSVC_MMGR_FREE_NCSXIR(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 1) - -#define m_OSSVC_MMGR_ALLOC_NCSSVENT (struct ncs_svcard_entry*)m_NCS_MEM_ALLOC(sizeof(struct ncs_svcard_entry), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 2) - -#define m_OSSVC_MMGR_FREE_NCSSVENT(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_COMMON, \ - 2) - -/** Imcomplete structure definitions - required by some compilers. - **/ -struct ncscc_call_data; -struct ncscc_conn_id; -struct ncs_sar_ctrl_info_tag; - -#define m_NATIVE_PORT_NUM(x) (unsigned int)((x)->native_ifcb) - -/**************************************************************************** - **************************************************************************** - **************************************************************************** - **************************************************************************** - ** ** - ** ** - ** Cache Allocation Interface ** - ** ** - ** ** - ** ** - ** ** - **************************************************************************** - **************************************************************************** - **************************************************************************** - ***************************************************************************/ - -#define m_NCS_CACHE_PREALLOC_ENTRIES(c) NCSCC_RC_SUCCESS -#define m_NCS_CACHE_FREE_PREALLOC_ENTRIES(c) - -#if (NCS_CACHING == 1) -/* Generic Cache Macros */ - -#define m_MMGR_ALLOC_CACHE \ - (CACHE *)m_NCS_MEM_ALLOC(sizeof(CACHE), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 5) -#define m_MMGR_ALLOC_HASH_TBL(s) \ - (CACHE_ENTRY *)m_NCS_MEM_ALLOC(sizeof(CACHE_ENTRY) * s, \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 6) - -#define m_MMGR_FREE_CACHE(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 5) -#define m_MMGR_FREE_HASH_TBL(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 6) - -#define m_MMGR_FREE_CACHE_ENTRY(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT \ - NCS_SERVICE_ID_OS_SVCS, 8) -#endif - -#define m_MMGR_ALLOC_NCS_STREE_ENTRY \ - (NCS_STREE_ENTRY*)m_NCS_MEM_ALLOC(sizeof(NCS_STREE_ENTRY), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 7) -#define m_MMGR_FREE_NCS_STREE_ENTRY(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 7) - -/**************************************************************************** - **************************************************************************** - **************************************************************************** - **************************************************************************** - ** ** - ** ** - ** Pointer Queueing Allocation Interface ** - ** ** - ** ** - ** ** - ** ** - **************************************************************************** - **************************************************************************** - **************************************************************************** - ***************************************************************************/ - -#define m_MMGR_ALLOC_NCS_QLINK \ - (NCS_QLINK*)m_NCS_MEM_ALLOC(sizeof(NCS_QLINK), \ - NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 9) - -#define m_MMGR_FREE_NCS_QLINK(p) m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT,\ - NCS_SERVICE_ID_OS_SVCS, 9) - -/* Encode/Decode(EDU) Malloc-Free macros */ -#define m_MMGR_ALLOC_EDP_ENTRY m_NCS_MEM_ALLOC(sizeof(EDP_ENTRY),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 10) - -#define m_MMGR_FREE_EDP_ENTRY(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 10) - -#define m_MMGR_ALLOC_EDU_PPDB_NODE_INFO m_NCS_MEM_ALLOC(sizeof(EDU_PPDB_NODE_INFO),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 11) - -#define m_MMGR_FREE_EDU_PPDB_NODE_INFO(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 11) - -#define m_MMGR_ALLOC_EDP_TEST_INSTR_REC m_NCS_MEM_ALLOC(sizeof(EDP_TEST_INSTR_REC),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 12) - -#define m_MMGR_FREE_EDP_TEST_INSTR_REC(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 12) - -#define m_MMGR_ALLOC_EDP_LABEL_ELEMENT m_NCS_MEM_ALLOC(sizeof(EDP_LABEL_ELEMENT),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 13) - -#define m_MMGR_FREE_EDP_LABEL_ELEMENT(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 13) - -#define m_MMGR_ALLOC_EDU_HDL_NODE m_NCS_MEM_ALLOC(sizeof(EDU_HDL_NODE),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 14) - -#define m_MMGR_FREE_EDU_HDL_NODE(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 14) - -#define m_MMGR_ALLOC_EDP_SELECT_ARRAY(cnt) m_NCS_MEM_ALLOC((cnt*sizeof(int)),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 15) - -#define m_MMGR_FREE_EDP_SELECT_ARRAY(p) \ - m_NCS_MEM_FREE(p, NCS_MEM_REGION_PERSISTENT, \ - NCS_SERVICE_ID_OS_SVCS, 15) - -/* EDU's EDP malloc calls. */ -/* List of basic types : - - char (C-type) - - short (C-type) - - int (C-type) - - long (C-type) - - double (C-type. Can be made uint32_t if not supported by compiler) - - float (C-type) - - ncs_bool (NCS-type, unsigned int.) - - uint8_t (NCS-type. unsigned char.) - - uint16_t (NCS-type. unsigned short.) - - uint32_t (NCS-type. unsigned int.) - - int8_t (NCS-type. signed char.) - - int16_t (NCS-type. signed short.) - - int32_t (NCS-type. signed long.) - - ncsfloat (C/NCS-type. float.) - - octet (C/NCS-type, uint8_t *) - */ -#define m_MMGR_ALLOC_EDP_bool m_NCS_MEM_ALLOC(sizeof(bool),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_CHAR(n) m_NCS_MEM_ALLOC(n * sizeof(char),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_SHORT m_NCS_MEM_ALLOC(sizeof(short),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_INT m_NCS_MEM_ALLOC(sizeof(int),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_LONG m_NCS_MEM_ALLOC(sizeof(long),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_DOUBLE m_NCS_MEM_ALLOC(sizeof(double),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_FLOAT m_NCS_MEM_ALLOC(sizeof(float),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_UNS8(n) m_NCS_MEM_ALLOC(n*sizeof(uint8_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_UNS16 m_NCS_MEM_ALLOC(sizeof(uint16_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_UNS32 m_NCS_MEM_ALLOC(sizeof(uint32_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_INT8 m_NCS_MEM_ALLOC(sizeof(int8_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_INT16 m_NCS_MEM_ALLOC(sizeof(int16_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_INT32 m_NCS_MEM_ALLOC(sizeof(int32_t),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -#define m_MMGR_ALLOC_EDP_NCSFLOAT32 m_NCS_MEM_ALLOC(sizeof(float),\ - NCS_MEM_REGION_PERSISTENT, NCS_SERVICE_ID_OS_SVCS, 0) - -/* - * m_LEAP_FAILURE - * - * If LEAP detects an error that just must be tended to, it will - * Call this macro. The associated function can be taken over by - * customers if they don't like NetPlane's default treatment (like - * forcing a crash). - * - * Events are............. - */ -#define NCSFAIL_DOUBLE_DELETE 1 -#define NCSFAIL_FREEING_NULL_PTR 2 -#define NCSFAIL_MEM_SCREWED_UP 3 -#define NCSFAIL_FAILED_BM_TEST 4 -#define NCSFAIL_MEM_NULL_POOL 5 -#define NCSFAIL_MEM_REC_CORRUPTED 6 -#define NCSFAIL_OWNER_CONFLICT 7 - -uint32_t leap_failure(uint32_t l, char *f, uint32_t e, uint32_t ret); - -#define m_LEAP_FAILURE(e,r) leap_failure(__LINE__,__FILE__,(uint32_t)e,(uint32_t)r) - -#endif diff --git a/osaf/libs/core/leap/sysf_def.c b/osaf/libs/core/leap/sysf_def.c --- a/osaf/libs/core/leap/sysf_def.c +++ b/osaf/libs/core/leap/sysf_def.c @@ -42,7 +42,6 @@ #include "ncs_svd.h" #include "ncssysf_def.h" #include "ncssysf_tmr.h" -#include "sysf_def.h" #include "ncssysf_lck.h" #include "ncssysfpool.h" #include "sysf_exc_scr.h" diff --git a/osaf/libs/core/leap/sysf_mem.c b/osaf/libs/core/leap/sysf_mem.c --- a/osaf/libs/core/leap/sysf_mem.c +++ b/osaf/libs/core/leap/sysf_mem.c @@ -51,7 +51,6 @@ #include "ncssysf_mem.h" #include "usrbuf.h" #include "ncsusrbuf.h" -#include "sysf_def.h" /*************************************************************************************/ diff --git a/osaf/libs/core/leap/sysf_tmr.c b/osaf/libs/core/leap/sysf_tmr.c --- a/osaf/libs/core/leap/sysf_tmr.c +++ b/osaf/libs/core/leap/sysf_tmr.c @@ -32,7 +32,6 @@ #include "ncs_osprm.h" #include "ncs_tmr.h" -#include "sysf_def.h" #include "ncssysf_def.h" #include "ncssysf_tmr.h" #include "ncssysf_tsk.h" ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel