• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. * Description: nv notify header
14  */
15 
16 #ifndef NV_NOTIFY_H
17 #define NV_NOTIFY_H
18 #ifdef CONFIG_NV_SUPPORT_SINGLE_CORE_SYSTEM
19 
20 #include "stdbool.h"
21 #include "nv.h"
22 #include "nv_porting.h"
23 #include "errcode.h"
24 
25 #ifdef __cplusplus
26 #if __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 #endif /* __cplusplus */
30 
31 typedef struct {
32     nv_changed_notify_func func;
33     uint16_t min_key;
34     uint16_t max_key;
35 } nv_changed_proc_t;
36 
37 typedef struct {
38     uint32_t nv_sem_handle;
39     nv_changed_proc_t *nv_change_notify_list;  /* Nv changed notify functions table */
40     uint8_t notify_regitser_max_nums;          /* Max number of nv changed notify functions */
41     uint8_t notify_registered_nums;            /* The number of nv changed notify functions */
42     uint16_t rsv2;
43 } nv_direct_ctrl_t;
44 
45 bool nv_change_notify_segment_is_valid(nv_direct_ctrl_t *nv_ctrl, uint16_t min_key, uint16_t max_key);
46 errcode_t nv_direct_notify_list_init(void);
47 void nv_change_notify(uint16_t key);
48 
49 #ifdef __cplusplus
50 #if __cplusplus
51 }
52 #endif /* __cplusplus */
53 #endif /* __cplusplus */
54 
55 #endif
56 #endif /* NV_NOTIFY_H */
57