sw_state_sync_db.h (1477B)
1 2 /* 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 7 * 8 * this module is used to store and acquire all of the device lock's, semaphores, mutexes etc. 9 */ 10 #ifndef _SW_STATE_SYNC_DB_H 11 #define _SW_STATE_SYNC_DB_H 12 13 #include <sal/core/sync.h> 14 #include <bcm/types.h> 15 16 typedef struct sw_state_dpp_sync_db_counter_s { 17 sal_thread_t background; /* unit background thread */ 18 sal_sem_t bgSem; /* unit background waiting sem */ 19 sal_mutex_t cacheLock; /* cache access locking */ 20 } sw_state_dpp_sync_db_counter_t; 21 22 typedef struct sw_state_dpp_sync_db_s{ 23 24 /* 25 * bcm locks 26 */ 27 sal_mutex_t stg_lock; 28 sal_mutex_t policer_lock; 29 sal_mutex_t mirror_lock; 30 sal_mutex_t l3_lock; 31 sal_mutex_t l2_lock; 32 sal_mutex_t trunk_lock; 33 sw_state_dpp_sync_db_counter_t counter; 34 sal_mutex_t unitLock; /* unit lock */ /* Moved from bcm_dpp_field_info_OLD_t */ 35 /* 36 * soc locks 37 */ 38 /* add dpp's soc mutexes and semaphores here */ 39 40 /* 41 * shared locks 42 */ 43 /* add shared mutexes and semaphores here */ 44 sal_mutex_t *htb_locks; 45 46 } sw_state_dpp_sync_db_t; 47 48 typedef struct sw_state_sync_db_s { 49 sw_state_dpp_sync_db_t dpp; 50 } sw_state_sync_db_t; 51 52 extern sw_state_sync_db_t sw_state_sync_db[BCM_MAX_NUM_UNITS]; 53 54 #endif /*_SW_STATE_SYNC_DB_H*/ 55