From 4e4b79bf56f6477b65973c869e5a8936aea27864 Mon Sep 17 00:00:00 2001 From: russell Date: Fri, 7 Jul 2006 18:03:59 +0000 Subject: merge vpm450m support git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@1206 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- include/apilib/octapi_bt0.h | 70 +++++++++++++++++++++ include/apilib/octapi_largmath.h | 62 +++++++++++++++++++ include/apilib/octapi_llman.h | 127 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 259 insertions(+) create mode 100644 include/apilib/octapi_bt0.h create mode 100644 include/apilib/octapi_largmath.h create mode 100644 include/apilib/octapi_llman.h (limited to 'include/apilib') diff --git a/include/apilib/octapi_bt0.h b/include/apilib/octapi_bt0.h new file mode 100644 index 0000000..a7dd534 --- /dev/null +++ b/include/apilib/octapi_bt0.h @@ -0,0 +1,70 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: octapi_bt0.h + +Copyright (c) 2001 Octasic Inc. All rights reserved. + +Description: + +This source code is Octasic Confidential. Use of and access to this code +is covered by the Octasic Device Enabling Software License Agreement. +Acknowledgement of the Octasic Device Enabling Software License was +required for access to this code. A copy was also provided with the release. + + +$Octasic_Release: OCT610xAPI-01.00-PR37 $ + +$Octasic_Revision: 10 $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +#ifndef __OCTAPI_BT0_H__ +#define __OCTAPI_BT0_H__ + + +#include "octdef.h" + + +#define OCTAPI_BT0_BASE 0xFFFF0000 +#define OCTAPI_BT0_KEY_SIZE_NOT_MUTLIPLE_OF_UINT32 OCTAPI_BT0_BASE+0x0001 +#define OCTAPI_BT0_DATA_SIZE_NOT_MUTLIPLE_OF_UINT32 OCTAPI_BT0_BASE+0x0002 +#define OCTAPI_BT0_MALLOC_FAILED OCTAPI_BT0_BASE+0x0003 +#define OCTAPI_BT0_NO_NODES_AVAILABLE OCTAPI_BT0_BASE+0x0004 +#define OCTAPI_BT0_KEY_ALREADY_IN_TREE OCTAPI_BT0_BASE+0x0005 +#define OCTAPI_BT0_KEY_NOT_IN_TREE OCTAPI_BT0_BASE+0x0006 + +/* Possible result for Find Or Add function.*/ +#define OCTAPI0_BT0_NODE_FOUND 0 +#define OCTAPI0_BT0_NODE_ADDDED 1 + +#define OCTAPI_BT0_NO_SMALLER_KEY 0xAAAAAAAA + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus*/ + +#define octapi_bt0_get_size( number_of_items, key_size, data_size, b_size ) OctApiBt0GetSize( (UINT32) number_of_items,(UINT32) key_size, (UINT32) data_size, (PUINT32) b_size ) +#define octapi_bt0_init(b, number_of_items, key_size, data_size) OctApiBt0Init( (void **) b,(UINT32) number_of_items,(UINT32) key_size, (UINT32) data_size ) +#define octapi_bt0_add_node( b, key, data ) OctApiBt0AddNode( (void *) b,(void *) key,(void **) data ) +#define octapi_bt0_remove_node( b, key ) OctApiBt0RemoveNode( (void *) b,(void *) key ) +#define octapi_bt0_query_node( b, key, data ) OctApiBt0QueryNode( (void *) b,(void *) key,(void **) data ) +#define octapi_bt0_get_first_node( b,key, data ) OctApiBt0GetFirstNode( (void *) b,(void **) key, (void **) data ) + + +static UINT32 OctApiBt0GetSize( UINT32 number_of_items,UINT32 key_size, UINT32 data_size, UINT32 * b_size ); +static UINT32 OctApiBt0Init( void ** b,UINT32 number_of_items,UINT32 key_size, UINT32 data_size ); +UINT32 OctApiBt0AddNode( void * b,void * key,void ** data ); +UINT32 OctApiBt0RemoveNode( void * b,void * key ); +UINT32 OctApiBt0QueryNode( void * b,void * key,void ** data ); +UINT32 OctApiBt0GetFirstNode( void * b,void ** key, void ** data ); +UINT32 OctApiBt0FindOrAddNode(void * b,void * key,void ** data, UINT32 *fnct_result); + +UINT32 OctApiBt0AddNodeReportPrevNodeData(void * b,void * key,void ** data, void ** prev_data, UINT32 *fnct_result ); + +#ifdef __cplusplus +} +#endif /* __cplusplus*/ + + + +#endif /*__OCTAPI_BT0_H__*/ diff --git a/include/apilib/octapi_largmath.h b/include/apilib/octapi_largmath.h new file mode 100644 index 0000000..dae120a --- /dev/null +++ b/include/apilib/octapi_largmath.h @@ -0,0 +1,62 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: octapi_largmath.h + +Copyright (c) 2001 Octasic Inc. All rights reserved. + +Description: + +This source code is Octasic Confidential. Use of and access to this code +is covered by the Octasic Device Enabling Software License Agreement. +Acknowledgement of the Octasic Device Enabling Software License was +required for access to this code. A copy was also provided with the release. + + +$Octasic_Release: OCT610xAPI-01.00-PR37 $ + +$Octasic_Revision: 5 $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +#ifndef __OCTAPI_LARGMATH_H__ +#define __OCTAPI_LARGMATH_H__ + + + +#include "octdef.h" + + + +#define OCTAPI_LM_DIVISION_BY_ZERO 0xFFFF +#define OCTAPI_LM_OVERFLOW 0xFFFE +#define OCTAPI_LM_ARRAY_SIZE_MISMATCH 0xFFFD + +#define OCTAPI_LM_MAX_OPTIMIZE_MUL 10 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus*/ + +#define octapi_lm_add( a, alen, b, blen, z, zlen) OctApiLmAdd( (PUINT32) a, (USHORT) alen, (PUINT32) b, (USHORT) blen, (PUINT32) z, (USHORT) zlen ) +#define octapi_lm_subtract( a, alen, bneg, blen, z, zlen, neg) OctApiLmSubtract( (PUINT32) a, (USHORT) alen, (PUINT32) bneg, (USHORT) blen, (PUINT32) z, (USHORT) zlen, (USHORT*) neg ) +#define octapi_lm_compare( a, alen, bneg, blen, neg) OctApiLmCompare( (PUINT32) a, (USHORT) alen, (PUINT32) bneg, (USHORT) blen, (USHORT*) neg ) +#define octapi_lm_multiply( a, b, ablen, z) OctApiLmMultiply( (PUINT32) a, (PUINT32) b, (USHORT) ablen, (PUINT32) z ) +#define octapi_lm_divide( n, d, q, r, ndqrlen) OctApiLmDivide( (PUINT32) n, (PUINT32) d, (PUINT32) q, (PUINT32) r, (USHORT) ndqrlen ) +#define octapi_lm_shiftright1( a, alen) OctApiLmShiftRight1( (PUINT32) a, (USHORT) alen ) +#define octapi_lm_shiftn( a, alen, shiftleft, shiftn) OctApiLmShiftn( (PUINT32) a, (USHORT) alen, (USHORT) shiftleft, (USHORT) shiftn ) +#define octapi_lm_getmsb( a, alen, msb_pos) OctApiLmGetMsb( (PUINT32) a, (USHORT) alen, (USHORT*) msb_pos ) + + +static UINT32 OctApiLmAdd( PUINT32 a, USHORT alen, PUINT32 b, USHORT blen, PUINT32 z, USHORT zlen ); +static UINT32 OctApiLmSubtract( PUINT32 a, USHORT alen, PUINT32 bneg, USHORT blen, PUINT32 z, USHORT zlen, PUSHORT neg ); +UINT32 OctApiLmCompare( PUINT32 a, USHORT alen, PUINT32 bneg, USHORT blen, PUSHORT neg ); +UINT32 OctApiLmMultiply( PUINT32 a, PUINT32 b, USHORT ablen, PUINT32 z ); +UINT32 OctApiLmDivide( PUINT32 n, PUINT32 d, PUINT32 q, PUINT32 r, USHORT ndqrlen ); +UINT32 OctApiLmShiftRight1( PUINT32 a, USHORT alen ); +UINT32 OctApiLmShiftn( PUINT32 a, USHORT alen, USHORT shiftleft, USHORT shiftn ); +UINT32 OctApiLmGetMsb( PUINT32 a, USHORT alen, PUSHORT msb_pos ); + +#ifdef __cplusplus +} +#endif /* __cplusplus*/ + +#endif /*__OCTAPI_LARGMATH_H__*/ diff --git a/include/apilib/octapi_llman.h b/include/apilib/octapi_llman.h new file mode 100644 index 0000000..467ed9c --- /dev/null +++ b/include/apilib/octapi_llman.h @@ -0,0 +1,127 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: octapi_llman.h + +Copyright (c) 2001 Octasic Inc. All rights reserved. + +Description: + +This source code is Octasic Confidential. Use of and access to this code +is covered by the Octasic Device Enabling Software License Agreement. +Acknowledgement of the Octasic Device Enabling Software License was +required for access to this code. A copy was also provided with the release. + + +$Octasic_Release: OCT610xAPI-01.00-PR37 $ + +$Octasic_Revision: 7 $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +#include "octdef.h" + +/* Error defines*/ +#define OCTAPI_LLM_MEMORY_NOT_ALLOCATED 0xFFFFFFFF +#define OCTAPI_LLM_NO_STRUCTURES_LEFT 0xFFFFFFFE +#define OCTAPI_LLM_BLOCKNUM_OUT_OF_RANGE 0xFFFFFFFD +#define OCTAPI_LLM_ELEMENT_ALREADY_ASSIGNED 0xFFFFFFFC +#define OCTAPI_LLM_ELEMENT_NOT_FOUND 0xFFFFFFFB +#define OCTAPI_LLM_LIST_EMPTY 0xFFFFFFFA +#define OCTAPI_LLM_INVALID_LIST_HANDLE 0xFFFFFFF9 +#define OCTAPI_LLM_TREE_NODE_ABSENT 0xFFFFFFF8 +#define OCTAPI_LLM_INTERNAL_ERROR0 0xFFFFFFF7 +#define OCTAPI_LLM_INTERNAL_ERROR1 0xFFFFFFF6 +#define OCTAPI_LLM_INVALID_PARAMETER 0xFFFFFFF5 + +#define OCTAPI_LLM2_MEMORY_NOT_ALLOCATED 0xFEFFFFFF +#define OCTAPI_LLM2_NO_STRUCTURES_LEFT 0xFEFFFFFE +#define OCTAPI_LLM2_BLOCKNUM_OUT_OF_RANGE 0xFEFFFFFD +#define OCTAPI_LLM2_ELEMENT_ALREADY_ASSIGNED 0xFEFFFFFC +#define OCTAPI_LLM2_ELEMENT_NOT_FOUND 0xFEFFFFFB +#define OCTAPI_LLM2_LIST_EMPTY 0xFEFFFFFA +#define OCTAPI_LLM2_INVALID_LIST_HANDLE 0xFEFFFFF9 +#define OCTAPI_LLM2_TREE_NODE_ABSENT 0xFEFFFFF8 +#define OCTAPI_LLM2_INTERNAL_ERROR0 0xFEFFFFF7 +#define OCTAPI_LLM2_INTERNAL_ERROR1 0xFEFFFFF6 +#define OCTAPI_LLM2_INVALID_PARAMETER 0xFEFFFFF5 + +/* Other defines*/ +#define OCTAPI_LLM_LIST_APPEND 0xFFFFFFFF +#define OCTAPI_LLM2_INSERT_ERROR 0xFFFFFFFF +#define OCTAPI_LLM2_INSERT_FIRST_NODE 0xFFFF0000 +#define OCTAPI_LLM2_INSERT_LIST_NODE 0xFFFF0001 +#define OCTAPI_LLM2_INSERT_LAST_NODE 0xFFFF0002 +#define OCTAPI_LLM2_INSERT_BEFORE_LAST_NODE 0xFFFF0003 +#define OCTAPI_LLM2_REMOVE_ERROR 0xFFFFFFFF +#define OCTAPI_LLM2_REMOVE_FIRST_NODE 0xFFFF0004 +#define OCTAPI_LLM2_REMOVE_LIST_NODE 0xFFFF0005 +#define OCTAPI_LLM2_REMOVE_LAST_NODE 0xFFFF0006 +#define OCTAPI_LLM2_REMOVE_BEFORE_LAST_NODE 0xFFFF0007 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus*/ + +#define octapi_llm_alloc_get_size( number_of_items, l_size) OctapiLlmAllocGetSize( (UINT32) number_of_items,(PUINT32) l_size ) +#define octapi_llm_alloc_init( l, number_of_items) OctapiLlmAllocInit( (PVOID*) l,(UINT32) number_of_items) +#define octapi_llm_alloc_info( l, allocated_items, available_items) OctapiLlmAllocInfo( (PVOID) l, (PUINT32) allocated_items, (PUINT32) available_items ) +#define octapi_llm_alloc_alloc( l, blocknum) OctapiLlmAllocAlloc( (PVOID) l, (PUINT32) blocknum ) +#define octapi_llm_alloc_dealloc( l, blocknum) OctapiLlmAllocDealloc( (PVOID) l,(UINT32) blocknum ) +#define octapi_llm_list_get_size( number_of_items, number_of_lists, user_info_size, l_size) OctApiLlmListGetSize( (UINT32) number_of_items,(UINT32) number_of_lists,(UINT32) user_info_size,(PUINT32) l_size ) +#define octapi_llm_list_init( l, number_of_items, number_of_lists, user_info_size) OctApiLlmListInit( (PVOID*) l,(UINT32) number_of_items,(UINT32) number_of_lists,(UINT32) user_info_size ) +#define octapi_llm_list_info( l, allocated_lists, allocated_items, free_lists, free_items ) OctApiLlmListInfo( (PVOID) l,(PUINT32) allocated_lists,(PUINT32) allocated_items,(PUINT32) free_lists,(PUINT32) free_items ) +#define octapi_llm_list_create( l, list_handle) OctApiLlmListCreate( (PVOID) l,(PUINT32) list_handle ) +#define octapi_llm_list_create_full( l, list_length, plist_handle) OctApiLlmListCreateFull( (PVOID) l, (UINT32) list_length, (PUINT32) plist_handle ) +#define octapi_llm_list_append_items( l, list_handle, num_items) OctApiLlmListAppendItems( (PVOID) l, (UINT32) list_handle, (UINT32) num_items ) +#define octapi_llm_list_append_and_set_items( l, list_handle, num_items, data_list) OctApiLlmListAppendAndSetItems( (PVOID) l, (UINT32) list_handle, (UINT32) num_items, (PVOID) data_list ) +#define octapi_llm_list_delete( l, list_handle ) OctApiLlmListDelete( (PVOID) l,(UINT32) list_handle ) +#define octapi_llm_list_length( l, list_handle, number_of_items_in_list) OctApiLlmListLength( (PVOID) l,(UINT32) list_handle, (PUINT32) number_of_items_in_list ) +#define octapi_llm_list_insert_item( l, list_handle, item_number, item_data_pnt) OctApiLlmListInsertItem( (PVOID) l,(UINT32) list_handle,(UINT32) item_number,(PVOID*) item_data_pnt ) +#define octapi_llm_list_remove_item( l, list_handle, item_number) OctApiLlmListRemoveItem( (PVOID) l,(UINT32) list_handle,(UINT32) item_number ) +#define octapi_llm_list_item_data( l, list_handle, item_number, item_data_pnt) OctApiLlmListItemData( (PVOID) l,(UINT32) list_handle,(UINT32) item_number,(PVOID*) item_data_pnt ) +#define octapi_llm_list_copy_data( l, list_handle, start_item, data_length, pdata_list) OctApiLlmListCopyData( (PVOID) l, (UINT32) list_handle, (UINT32) start_item, (UINT32) data_length, (PVOID) pdata_list ) +#define octapi_llm_list_set_items( l, list_handle, start_item, data_length, pdata_list) OctApiLlmListSetItems( (PVOID) l, (UINT32) list_handle, (UINT32) start_item, (UINT32) data_length, (PVOID) pdata_list ) + + +/* Alloc man.*/ +static UINT32 OctapiLlmAllocGetSize( UINT32 number_of_items,PUINT32 l_size ); +static UINT32 OctapiLlmAllocInit( PVOID* l,UINT32 number_of_items); +static UINT32 OctapiLlmAllocInfo( PVOID l, PUINT32 allocated_items, PUINT32 available_items ); +static UINT32 OctapiLlmAllocAlloc( PVOID l, PUINT32 blocknum ); +static UINT32 OctapiLlmAllocDealloc( PVOID l,UINT32 blocknum ); + +/* Time managed alloc man.*/ +UINT32 OctApiTllmAllocGetSize( UINT32 number_of_items, PUINT32 l_size ); +UINT32 OctApiTllmAllocInit( PVOID* l, UINT32 number_of_items ); +UINT32 OctApiTllmAllocInfo( PVOID l, PUINT32 allocated_items, PUINT32 available_items ); +UINT32 OctApiTllmAllocAlloc( PVOID l, PUINT32 blocknum, UINT32 current_time[2] ); +UINT32 OctApiTllmAllocDealloc( PVOID l, UINT32 blocknum, UINT32 timeout_value, UINT32 current_time[2] ); + +/* List man.*/ +UINT32 OctApiLlmListGetSize( UINT32 number_of_items,UINT32 number_of_lists,UINT32 user_info_size,PUINT32 l_size ); +UINT32 OctApiLlmListInit( PVOID* l,UINT32 number_of_items,UINT32 number_of_lists,UINT32 user_info_size ); +UINT32 OctApiLlmListInfo( PVOID l,PUINT32 allocated_lists,PUINT32 allocated_items,PUINT32 free_lists,PUINT32 free_items ); +UINT32 OctApiLlmListCreate( PVOID l,PUINT32 list_handle ); +UINT32 OctApiLlmListCreateFull( PVOID l, UINT32 list_length, UINT32* plist_handle ); +UINT32 OctApiLlmListAppendItems( PVOID l, UINT32 list_handle, UINT32 num_items ); +UINT32 OctApiLlmListAppendAndSetItems( PVOID l, UINT32 list_handle, UINT32 num_items, PVOID data_list ); +UINT32 OctApiLlmListDelete( PVOID l,UINT32 list_handle ); +UINT32 OctApiLlmListLength( PVOID l,UINT32 list_handle, PUINT32 number_of_items_in_list ); +UINT32 OctApiLlmListInsertItem( PVOID l,UINT32 list_handle,UINT32 item_number,PVOID* item_data_pnt ); +UINT32 OctApiLlmListRemoveItem( PVOID l,UINT32 list_handle,UINT32 item_number ); +UINT32 OctApiLlmListItemData( PVOID l,UINT32 list_handle,UINT32 item_number,PVOID* item_data_pnt ); +UINT32 OctApiLlmListCopyData( PVOID l, UINT32 list_handle, UINT32 start_item, UINT32 data_length, PVOID pdata_list ); +UINT32 OctApiLlmListSetItems( PVOID l, UINT32 list_handle, UINT32 start_item, UINT32 data_length, PVOID pdata_list ); + +/* Second list manager using a key to order info in the list.*/ +UINT32 OctApiLlm2ListGetSize( UINT32 number_of_items,UINT32 number_of_lists,UINT32 user_info_size,PUINT32 l_size ); +UINT32 OctApiLlm2ListInit( PVOID* l,UINT32 number_of_items,UINT32 number_of_lists,UINT32 user_info_size ); +UINT32 OctApiLlm2ListCreate( PVOID l,PUINT32 list_handle ); +UINT32 OctApiLlm2ListLength( PVOID l,UINT32 list_handle, PUINT32 number_of_items_in_list ); +UINT32 OctApiLlm2ListInsertItem(void * l,UINT32 list_handle,UINT32 item_key,void ** item_data_pnt, void ** prev_item_data_pnt, void ** prev_prev_item_data_pnt, PUINT32 insert_status_pnt ); +UINT32 OctApiLlm2ListRemoveItem(void * l,UINT32 list_handle,UINT32 item_key, PUINT32 prev_item_key_pnt, PUINT32 prev_prev_item_key_pnt, PUINT32 remove_status_pnt ); +UINT32 OctApiLlm2ListItemData( PVOID l,UINT32 list_handle,UINT32 item_key,PVOID* item_data_pnt, PUINT32 item_number ); + + +#ifdef __cplusplus +} +#endif /* __cplusplus*/ -- cgit v1.2.3