@@ -37,33 +37,30 @@ void __svc_not_implemented(void)
3737}
3838
3939/* SVC handlers */
40- const void * const g_svc_vtor_tbl [] = {
41- __svc_not_implemented , // 0
42- unvic_isr_set , // 1
43- unvic_isr_get , // 2
44- unvic_irq_enable , // 3
45- unvic_irq_disable , // 4
46- unvic_irq_pending_clr , // 5
47- unvic_irq_pending_set , // 6
48- unvic_irq_pending_get , // 7
49- unvic_irq_priority_set , // 8
50- unvic_irq_priority_get , // 9
51- __svc_not_implemented , // 10 Deprecated: benchmark_configure
52- __svc_not_implemented , // 11 Deprecated: benchmark_start
53- __svc_not_implemented , // 12 Deprecated: benchmark_stop
54- halt_user_error , // 13
55- unvic_irq_level_get , // 14
56- __svc_not_implemented , // 15 Deprecated: vmpu_box_id_self
57- __svc_not_implemented , // 16 Deprecated: vmpu_box_id_caller
58- vmpu_box_namespace_from_id , // 17
59- debug_reboot , // 18
60- /* FIXME: This function will be made automatic when the debug box ACL is
61- * introduced. The initialization will happen at uVisor boot time. */
62- debug_register_driver , // 19
63- unvic_irq_disable_all , // 20
64- unvic_irq_enable_all , // 21
65- page_allocator_malloc , // 22
66- page_allocator_free , // 23
40+ const UvisorSvcTarget g_svc_vtor_tbl = {
41+ .not_implemented = __svc_not_implemented ,
42+
43+ .irq_enable = unvic_irq_enable ,
44+ .irq_disable = unvic_irq_disable ,
45+ .irq_disable_all = unvic_irq_disable_all ,
46+ .irq_enable_all = unvic_irq_enable_all ,
47+ .irq_set_vector = unvic_isr_set ,
48+ .irq_get_vector = unvic_isr_get ,
49+ .irq_set_pending = unvic_irq_pending_set ,
50+ .irq_get_pending = unvic_irq_pending_get ,
51+ .irq_clear_pending = unvic_irq_pending_clr ,
52+ .irq_set_priority = unvic_irq_priority_set ,
53+ .irq_get_priority = unvic_irq_priority_get ,
54+ .irq_get_level = unvic_irq_level_get ,
55+ .irq_system_reset = debug_reboot ,
56+
57+ .page_malloc = page_allocator_malloc ,
58+ .page_free = page_allocator_free ,
59+
60+ .box_namespace = vmpu_box_namespace_from_id ,
61+
62+ .debug_init = debug_register_driver ,
63+ .error = halt_user_error ,
6764};
6865
6966/*******************************************************************************
@@ -246,7 +243,7 @@ void UVISOR_NAKED SVCall_IRQn_Handler(void)
246243
247244 :: [svc_mode_mask ] "I" ((UVISOR_SVC_MODE_MASK ) & 0xFF ),
248245 [svc_fast_index_mask ] "I" ((UVISOR_SVC_FAST_INDEX_MASK ) & 0xFF ),
249- [svc_vtor_tbl_count ] "i" (UVISOR_ARRAY_COUNT (g_svc_vtor_tbl ) - 1 ),
246+ [svc_vtor_tbl_count ] "i" (sizeof (g_svc_vtor_tbl ) / sizeof ( uint32_t ) - 1 ),
250247 [priv_svc_0 ] "m" (g_priv_sys_hooks .priv_svc_0 )
251248 );
252249}
@@ -262,5 +259,5 @@ void svc_init(void)
262259 /* sanity checks */
263260 assert ((& jump_table_unpriv_end - & jump_table_unpriv ) == UVISOR_SVC_FAST_INDEX_MAX );
264261 assert ((& jump_table_priv_end - & jump_table_priv ) == UVISOR_SVC_FAST_INDEX_MAX );
265- assert (UVISOR_ARRAY_COUNT (g_svc_vtor_tbl ) <= UVISOR_SVC_SLOW_INDEX_MAX );
262+ assert (sizeof (g_svc_vtor_tbl ) / sizeof ( uint32_t ) <= UVISOR_SVC_SLOW_INDEX_MAX );
266263}
0 commit comments