VSF Documented
vsf_arch_abstraction.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_ARCH_ABSTRACTION_H__
19#define __VSF_ARCH_ABSTRACTION_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/*============================ MACROS ========================================*/
31
34#define VSF_SYSTIMER_IMPL_NONE 0
35#define VSF_SYSTIMER_IMPL_REQUEST_RESPONSE 1
36#define VSF_SYSTIMER_IMPL_WITH_NORMAL_TIMER 2
37#define VSF_SYSTIMER_IMPL_WITH_COMP_TIMER 3
38#define VSF_SYSTIMER_IMPL_TICK_MODE 4
40
41/*============================ MACROFIED FUNCTIONS ===========================*/
42
43#ifndef VSF_ARCH_ASSERT
44# define VSF_ARCH_ASSERT(...) VSF_ASSERT(__VA_ARGS__)
45#endif
46
47/*============================ TYPES =========================================*/
48
49/*\note generic prototypes MUST be defined before including the arch header. */
50typedef void vsf_irq_handler_t(void *p);
52
54typedef struct vsf_protect_region_t {
56 void (*leave)(vsf_protect_t orig);
58
64};
65
66/*============================ GLOBAL VARIABLES ==============================*/
67
70
71/*============================ LOCAL VARIABLES ===============================*/
72
73#ifdef __cplusplus
74}
75#endif
76
77/*============================ INCLUDES ======================================*/
78
79#if !defined(VSF_ARCH_HEADER)
81# if defined(__RTOS__)
82# define VSF_ARCH_HEADER "./rtos/rtos_generic.h"
83# elif defined(__CPU_GENERIC__)
84# if defined(__MACOS__)
85# define VSF_ARCH_HEADER "./generic/macos/macos_generic.h"
86# elif defined(__LINUX__)
87# define VSF_ARCH_HEADER "./generic/linux/linux_generic.h"
88# else
89# error not supported generic arch
90# endif
91# elif (defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M') || __TARGET_PROFILE_M
92# define VSF_ARCH_HEADER "./arm/cortex-m/cortex_m_generic.h"
93# elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'A' || __TARGET_PROFILE_A
94# define VSF_ARCH_HEADER "./arm/cortex-a/cortex_a_generic.h"
95# elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'R' || __TARGET_PROFILE_R
96# define VSF_ARCH_HEADER "./arm/cortex-r/cortex_r_generic.h"
97// check __WIN__ before __LINUX__ because some software(like SDL2) will define __LINUX__
98# elif (defined(__CPU_X86__) || defined(__CPU_X64__)) && defined(__WIN__)
99# define VSF_ARCH_HEADER "./x86/win/win_generic.h"
100# elif (defined(__CPU_X86__) || defined(__CPU_X64__) || defined(__CPU_WEBASSEMBLY__)) && defined(__LINUX__)
101# define VSF_ARCH_HEADER "./generic/linux/linux_generic.h"
102# elif defined(__CPU_MCS51__)
103# define VSF_ARCH_HEADER "./mcs51/mcs51_generic.h"
104# elif defined(__CPU_RV__) || defined(__CPU_RISCV__)
105# define VSF_ARCH_HEADER "./rv/rv_generic.h"
106# elif defined(__CPU_ARM9__)
107# define VSF_ARCH_HEADER "./arm/arm9/arm9_generic.h"
108# else
109# warning no supported architecture found, use default arch template!
110# define VSF_ARCH_HEADER "./template/template_generic.h"
111# endif
112#endif
113#include VSF_ARCH_HEADER
114
115#ifdef __cplusplus
116extern "C" {
117#endif
118
119/*============================ MACROS ========================================*/
120
121#ifndef VSF_ARCH_SWI_NUM
122# define VSF_ARCH_SWI_NUM 0
123#endif
124#ifndef VSF_DEV_SWI_NUM
125# define VSF_DEV_SWI_NUM 0
126#endif
127
128#ifndef __BYTE_ORDER
129# error "__BYTE_ORDER MUST be defined in arch"
130#endif
131
132#define VSF_SWI_NUM (VSF_ARCH_SWI_NUM + VSF_DEV_SWI_NUM)
133
134#define bswap16 bswap_16
135#define bswap32 bswap_32
136#define bswap64 bswap_64
137#if __BYTE_ORDER == __BIG_ENDIAN
138# define htobe16
139# define htole16 bswap_16
140# define be16toh
141# define le16toh bswap_16
142# define htobe32
143# define htole32 bswap_32
144# define be32toh
145# define le32toh bswap_32
146# define htobe64
147# define htole64 bswap_64
148# define be64toh
149# define le64toh bswap_64
150
151# define cpu_to_le16 bswap_16
152# define cpu_to_le32 bswap_32
153# define cpu_to_le64 bswap_64
154# define le16_to_cpu bswap_16
155# define le32_to_cpu bswap_32
156# define le64_to_cpu bswap_64
157# define cpu_to_be16
158# define cpu_to_be32
159# define cpu_to_be64
160# define be16_to_cpu
161# define be32_to_cpu
162# define be64_to_cpu
163#else
164# define htobe16 bswap_16
165# define htole16
166# define be16toh bswap_16
167# define le16toh
168# define htobe32 bswap_32
169# define htole32
170# define be32toh bswap_32
171# define le32toh
172# define htobe64 bswap_64
173# define htole64
174# define be64toh bswap_64
175# define le64toh
176
177# define cpu_to_le16
178# define cpu_to_le32
179# define cpu_to_le64
180# define le16_to_cpu
181# define le32_to_cpu
182# define le64_to_cpu
183# define cpu_to_be16 bswap_16
184# define cpu_to_be32 bswap_32
185# define cpu_to_be64 bswap_64
186# define be16_to_cpu bswap_16
187# define be32_to_cpu bswap_32
188# define be64_to_cpu bswap_64
189#endif
190
191#define DECLARE_ENDIAN_FUNC(__bitlen) \
192extern uint_fast##__bitlen##_t cpu_to_le##__bitlen##p(uint##__bitlen##_t *); \
193extern uint_fast##__bitlen##_t cpu_to_be##__bitlen##p(uint##__bitlen##_t *); \
194extern uint_fast##__bitlen##_t le##__bitlen##_to_cpup(uint##__bitlen##_t *); \
195extern uint_fast##__bitlen##_t be##__bitlen##_to_cpup(uint##__bitlen##_t *); \
196extern void cpu_to_le##__bitlen##s(uint##__bitlen##_t *); \
197extern void cpu_to_be##__bitlen##s(uint##__bitlen##_t *); \
198extern void le##__bitlen##_to_cpus(uint##__bitlen##_t *); \
199extern void be##__bitlen##_to_cpus(uint##__bitlen##_t *); \
200extern uint_fast##__bitlen##_t get_unaligned_cpu##__bitlen(const void *); \
201extern uint_fast##__bitlen##_t get_unaligned_le##__bitlen(const void *); \
202extern uint_fast##__bitlen##_t get_unaligned_be##__bitlen(const void *); \
203extern void put_unaligned_cpu##__bitlen(uint_fast##__bitlen##_t, void *); \
204extern void put_unaligned_le##__bitlen(uint_fast##__bitlen##_t, void *); \
205extern void put_unaligned_be##__bitlen(uint_fast##__bitlen##_t, void *);
206
207#define __vsf_protect_region(__region) \
208 for (vsf_protect_t VSF_MACRO_SAFE_NAME(protect_status), \
209 VSF_MACRO_SAFE_NAME(local_cnt) = 1; \
210 (((__region) != NULL) && VSF_MACRO_SAFE_NAME(local_cnt)--) ? \
211 ((VSF_MACRO_SAFE_NAME(protect_status) = (__region)->enter()), true) : false;\
212 (__region)->leave(VSF_MACRO_SAFE_NAME(protect_status)))
213#define vsf_protect_region(__region) __vsf_protect_region(__region)
214#define vsf_protect_region_exit(__region) continue
215
216#define vsf_protect_region_simple(__region, ...) \
217 do { \
218 if (__region != NULL) { \
219 vsf_protect_t VSF_MACRO_SAFE_NAME(protect_status) = (__region)->enter();\
220 __VA_ARGS__; \
221 (__region)->leave(VSF_MACRO_SAFE_NAME(protect_status)); \
222 } \
223 } while (0);
224
229// Usage:
230// __vsf_interrupt_safe(code)
231#ifndef __vsf_interrupt_safe
232# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
233# define __vsf_interrupt_safe(__code) \
234 { \
235 vsf_gint_state_t VSF_MACRO_SAFE_NAME(gint_state) = vsf_disable_interrupt();\
236 __code; \
237 vsf_set_interrupt(VSF_MACRO_SAFE_NAME(gint_state)); \
238 }
239# else
240# define __vsf_interrupt_safe(...) \
241 { \
242 vsf_gint_state_t VSF_MACRO_SAFE_NAME(gint_state) = vsf_disable_interrupt();\
243 __VA_ARGS__; \
244 vsf_set_interrupt(VSF_MACRO_SAFE_NAME(gint_state)); \
245 }
246# endif
247#endif
248
249// Usage:
250// vsf_interrupt_safe() {
251// code
252// }
253#ifndef vsf_interrupt_safe
254# define vsf_interrupt_safe() vsf_protect_region(&vsf_protect_region_int)
255#endif
256
257
258// Usage:
259// vsf_interrupt_safe_simple(
260// code
261// )
262#ifndef vsf_interrupt_safe_simple
263
264# define vsf_interrupt_safe_simple(...) \
265 vsf_protect_region_simple(&vsf_protect_region_int, __VA_ARGS__)
266
267#endif
268
269
270#define vsf_protect_interrupt() vsf_disable_interrupt()
271#define vsf_unprotect_interrupt(__state) vsf_set_interrupt(__state)
272#define vsf_protect_none() (0)
273#define vsf_unprotect_none(__state) VSF_UNUSED_PARAM(__state)
274
275#define vsf_protect_int vsf_protect_interrupt
276#define vsf_unprotect_int vsf_unprotect_interrupt
277
278#define __vsf_protect(__type) vsf_protect_##__type
279#define __vsf_unprotect(__type) vsf_unprotect_##__type
280#define vsf_protect(__type) __vsf_protect(__type)
281#define vsf_unprotect(__type) __vsf_unprotect(__type)
282
283// atom
284
285#ifndef vsf_atom64_op
286# define vsf_atom64_op(__ptr, ...) \
287 ({ \
288 vsf_protect_t VSF_MACRO_SAFE_NAME(orig) = vsf_protect_int(); \
289 int64_t _ = (*(int64_t *)(__ptr)); \
290 *(int64_t *)(__ptr) = (__VA_ARGS__); \
291 vsf_unprotect_int(VSF_MACRO_SAFE_NAME(orig)); \
292 _; \
293 })
294#endif
295
296#ifndef vsf_atom32_op
297# define vsf_atom32_op(__ptr, ...) \
298 ({ \
299 vsf_protect_t VSF_MACRO_SAFE_NAME(orig) = vsf_protect_int(); \
300 int32_t _ = (*(int32_t *)(__ptr)); \
301 *(int32_t *)(__ptr) = (__VA_ARGS__); \
302 vsf_unprotect_int(VSF_MACRO_SAFE_NAME(orig)); \
303 _; \
304 })
305#endif
306
307#ifndef vsf_atom16_op
308# define vsf_atom16_op(__ptr, ...) \
309 ({ \
310 vsf_protect_t VSF_MACRO_SAFE_NAME(orig) = vsf_protect_int(); \
311 int16_t _ = (*(int16_t *)(__ptr)); \
312 *(int16_t *)(__ptr) = (__VA_ARGS__); \
313 vsf_unprotect_int(VSF_MACRO_SAFE_NAME(orig)); \
314 _; \
315 })
316#endif
317
318#ifndef vsf_atom8_op
319# define vsf_atom8_op(__ptr, ...) \
320 ({ \
321 vsf_protect_t VSF_MACRO_SAFE_NAME(orig) = vsf_protect_int(); \
322 int8_t _ = (*(int8_t *)(__ptr)); \
323 *(int8_t *)(__ptr) = (__VA_ARGS__); \
324 vsf_unprotect_int(VSF_MACRO_SAFE_NAME(orig)); \
325 _; \
326 })
327#endif
328
329#ifndef vsf_atom_add
330# define vsf_atom_add(__bitlen, __ptr, __value) \
331 VSF_MCONNECT(vsf_atom, __bitlen, _op)((__ptr), _ + (__value))
332#endif
333#ifndef vsf_atom_dec
334# define vsf_atom_dec(__bitlen, __ptr, __value) \
335 vsf_atom_add(__bitlen, (__ptr), - (__value))
336#endif
337#ifndef vsf_atom_or
338# define vsf_atom_or(__bitlen, __ptr, __value) \
339 VSF_MCONNECT(vsf_atom, __bitlen, _op)((__ptr), _ | (__value))
340#endif
341#ifndef vsf_atom_and
342# define vsf_atom_and(__bitlen, __ptr, __value) \
343 VSF_MCONNECT(vsf_atom, __bitlen, _op)((__ptr), _ & (__value))
344#endif
345#ifndef vsf_atom_xor
346# define vsf_atom_xor(__bitlen, __ptr, __value) \
347 VSF_MCONNECT(vsf_atom, __bitlen, _op)((__ptr), _ ^ (__value))
348#endif
349#ifndef vsf_atom_xchg
350# define vsf_atom_xchg(__bitlen, __ptr, __new_value) \
351 VSF_MCONNECT(vsf_atom, __bitlen, _op)((__ptr), (__new_value))
352#endif
353
354// host invoke
355#define vsf_arch_host_invoke_ctx_t(__name) VSF_MCONNECT(__name, _ctx_t)
356#define declare_vsf_arch_host_invoke(__name) \
357 typedef struct vsf_arch_host_invoke_ctx_t(__name) \
358 vsf_arch_host_invoke_ctx_t(__name); \
359 typedef struct VSF_MCONNECT(__name, _t) VSF_MCONNECT(__name, _t); \
360 extern void VSF_MCONNECT(__name, _callback_t) \
361 (vsf_arch_host_invoke_ctx_t(__name) *ctx); \
362 extern VSF_MCONNECT(__name, _t) VSF_MCONNECT(__name, _instance);
363#define dcl_vsf_arch_host_invoke declare_vsf_arch_host_invoke
364#define define_vsf_arch_host_invoke(__name, ...) \
365 typedef struct vsf_arch_host_invoke_ctx_t(__name) { \
366 int __dummy; \
367 __VA_ARGS__ \
368 } vsf_arch_host_invoke_ctx_t(__name); \
369 typedef struct VSF_MCONNECT(__name, _t) { \
370 implement(vsf_arch_irq_thread_t); \
371 vsf_arch_irq_request_t request; \
372 vsf_eda_t *caller; \
373 vsf_arch_host_invoke_ctx_t(__name) ctx; \
374 } VSF_MCONNECT(__name, _t);
375#define def_vsf_arch_host_invoke define_vsf_arch_host_invoke
376#define implement_vsf_arch_host_invoke(__name) \
377 VSF_MCONNECT(__name, _t) VSF_MCONNECT(__name, _instance); \
378 extern void VSF_MCONNECT(__name, _callback_t) \
379 (vsf_arch_host_invoke_ctx_t(__name) *ctx); \
380 static void VSF_MCONNECT(__name, _thread)(void *arg) \
381 { \
382 vsf_eda_t *caller; \
383 VSF_MCONNECT(__name, _t) *ctx = arg; \
384 __vsf_arch_irq_set_background(&ctx->use_as__vsf_arch_irq_thread_t); \
385 while (1) { \
386 __vsf_arch_irq_request_pend(&ctx->request); \
387 VSF_MCONNECT(__name, _callback_t)(&ctx->ctx); \
388 \
389 __vsf_arch_irq_start(&ctx->use_as__vsf_arch_irq_thread_t); \
390 caller = ctx->caller; \
391 if (caller != NULL) { \
392 ctx->caller = NULL; \
393 vsf_eda_post_evt(caller, VSF_EVT_USER); \
394 } \
395 __vsf_arch_irq_end(&ctx->use_as__vsf_arch_irq_thread_t, false); \
396 } \
397 } \
398 void VSF_MCONNECT(__name, _callback_t)(vsf_arch_host_invoke_ctx_t(__name) *_)
399#define imp_vsf_arch_host_invoke implement_vsf_arch_host_invoke
400#define initialize_vsf_arch_host_invoke(__name, __priority) \
401 do { \
402 memset(&VSF_MCONNECT(__name, _instance), 0, \
403 sizeof(VSF_MCONNECT(__name, _t))); \
404 __vsf_arch_irq_request_init(&VSF_MCONNECT(__name, _instance).request);\
405 __vsf_arch_irq_init( \
406 &VSF_MCONNECT(__name, _instance).use_as__vsf_arch_irq_thread_t,\
407 VSF_STR(__name), VSF_MCONNECT(__name, _thread), (__priority));\
408 } while (0)
409#define init_vsf_arch_host_invoke initialize_vsf_arch_host_invoke
410#define vsf_arch_host_invoke_nb(__name, __eda_ptr, __ctx_ptr) \
411 do { \
412 VSF_MCONNECT(__name, _instance).ctx = *(__ctx_ptr); \
413 VSF_MCONNECT(__name, _instance).caller = (__eda_ptr); \
414 __vsf_arch_irq_request_send(&VSF_MCONNECT(__name, _instance).request);\
415 } while (0)
416#define vsf_arch_host_invoke_get_result_nb(__name, __ctx_ptr) \
417 do { \
418 *(__ctx_ptr) = VSF_MCONNECT(__name, _instance).ctx; \
419 } while (0)
420#define vsf_arch_host_invoke_in_thread(__name, __ctx_ptr) \
421 do { \
422 vsf_eda_t VSF_MACRO_SAFE_NAME(eda) = vsf_eda_get_cur(); \
423 VSF_ARCH_ASSERT(VSF_MACRO_SAFE_NAME(eda) != NULL); \
424 vsf_arch_host_invoke_nb(__name, VSF_MACRO_SAFE_NAME(eda), (__ctx_ptr));\
425 vsf_thread_wfe(VSF_EVT_USER); \
426 vsf_arch_host_invoke_get_result_nb(__name, __ctx_ptr); \
427 } while (0)
428
429/*============================ PROTOTYPES ====================================*/
430
431#if VSF_ARCH_PROVIDE_HEAP == ENABLED
433extern void * vsf_arch_heap_realloc(void *buffer, uint_fast32_t size);
434extern void vsf_arch_heap_free(void *buffer);
435extern unsigned int vsf_arch_heap_alignment(void);
436extern uint_fast32_t vsf_arch_heap_size(void *buffer);
437# if VSF_ARCH_HEAP_HAS_STATISTICS == ENABLED
443# endif
444#endif
445
446/*----------------------------------------------------------------------------*
447 * Architecture Infrastructure *
448 *----------------------------------------------------------------------------*/
449
450#ifndef VSF_FFS32
451// returns the first bits(start from 0) which is '1'
452// if all bits are 0s, -1 is returned
454#endif
455
456#ifndef VSF_FFZ32
458#endif
459
460#ifndef VSF_MSB32
462#endif
463
464#ifndef VSF_CLZ32
466#endif
467
468#if VSF_APPLET_USE_ARCH == ENABLED
469typedef struct vsf_arch_vplt_t {
471
476# ifndef __VSF_APPLET__
478# endif
479#endif
480
481#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_ARCH_LIB__))\
482 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_APPLET_USE_ARCH == ENABLED
483
484#ifndef VSF_APPLET_ARCH_VPLT
485# define VSF_APPLET_ARCH_VPLT \
486 ((vsf_arch_vplt_t *)(((vsf_vplt_t *)vsf_vplt((void *)0))->arch_vplt))
487#endif
488
489#define VSF_APPLET_ARCH_ENTRY(__NAME) \
490 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_APPLET_ARCH_VPLT, __NAME)
491#define VSF_APPLET_ARCH_IMP(...) \
492 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_APPLET_ARCH_VPLT, __VA_ARGS__)
493
494VSF_APPLET_ARCH_IMP(bswap_16, uint_fast16_t, uint_fast16_t value) {
496 return VSF_APPLET_ARCH_ENTRY(bswap_16)(value);
497}
498VSF_APPLET_ARCH_IMP(bswap_32, uint_fast32_t, uint_fast32_t value) {
500 return VSF_APPLET_ARCH_ENTRY(bswap_32)(value);
501}
502VSF_APPLET_ARCH_IMP(bswap_64, uint_fast64_t, uint_fast64_t value) {
504 return VSF_APPLET_ARCH_ENTRY(bswap_64)(value);
505}
506
507#else
508
511#ifdef UINT64_MAX
512extern uint_fast64_t bswap_64(uint_fast64_t);
513#endif
514
517#ifdef UINT64_MAX
519#endif
520
521#endif
522
523/*----------------------------------------------------------------------------*
524 * SWI *
525 *----------------------------------------------------------------------------*/
526
528 vsf_arch_prio_t priority,
529 vsf_swi_handler_t *handler,
530 void *param);
531extern void vsf_swi_trigger(uint_fast8_t idx);
532
536extern void vsf_arch_swi_trigger(uint_fast8_t idx);
537
538/*----------------------------------------------------------------------------*
539 * System Timer *
540 *----------------------------------------------------------------------------*/
541
542#ifdef VSF_SYSTIMER_CFG_IMPL_MODE
543extern vsf_err_t vsf_systimer_start(void);
546extern void vsf_systimer_set_idle(void);
548extern void vsf_systimer_prio_set(vsf_arch_prio_t priority);
549extern uint32_t vsf_systimer_get_freq(void);
550
555#endif
556
557
558/*----------------------------------------------------------------------------*
559 * Interrupt *
560 *----------------------------------------------------------------------------*/
561
564
565extern int vsf_get_interrupt_id(void);
570
571extern void vsf_arch_sleep(uint_fast32_t mode);
572extern void vsf_arch_reset(void);
573extern void vsf_arch_shutdown(void);
574// vsf_arch_main is only used in some special arch, eg: wasm
575// and normally used with VSF_ARCH_ENTRY_NO_PENDING
576extern void vsf_arch_main(void);
577
578#ifdef __cplusplus
579}
580#endif
581
582#endif
583/* EOF */
vsf_err_t
Definition __type.h:42
uint_fast8_t uintalu_t
Definition type.h:88
bool
Definition type.h:60
vsf_arch_prio_t
Definition cortex_a_generic.h:88
uint64_t vsf_systimer_tick_t
Definition cortex_a_generic.h:73
void vsf_systimer_prio_set(vsf_arch_prio_t priority)
Definition cortex_m_generic.c:185
vsf_systimer_tick_t vsf_systimer_get(void)
Definition linux_generic.c:402
void vsf_systimer_set_idle(void)
Definition linux_generic.c:398
vsf_systimer_tick_t vsf_systimer_tick_to_us(vsf_systimer_tick_t tick)
Definition linux_generic.c:445
bool vsf_systimer_is_due(vsf_systimer_tick_t due)
Definition linux_generic.c:430
vsf_systimer_tick_t vsf_systimer_ms_to_tick(uint_fast32_t time_ms)
Definition linux_generic.c:440
vsf_systimer_tick_t vsf_systimer_us_to_tick(uint_fast32_t time_us)
Definition linux_generic.c:435
vsf_systimer_tick_t vsf_systimer_tick_to_ms(vsf_systimer_tick_t tick)
Definition linux_generic.c:450
vsf_err_t vsf_systimer_start(void)
Definition linux_generic.c:390
bool vsf_systimer_set(vsf_systimer_tick_t due)
Definition linux_generic.c:409
uint32_t uintptr_t
Definition stdint.h:38
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned uint32_t
Definition stdint.h:9
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned short uint_fast16_t
Definition stdint.h:25
unsigned long long uint_fast64_t
Definition stdint.h:29
char int_fast8_t
Definition stdint.h:22
Definition vsf_arch_abstraction.h:438
uint32_t used_size
Definition vsf_arch_abstraction.h:440
uint32_t all_size
Definition vsf_arch_abstraction.h:439
Definition vsf_arch_abstraction.h:60
vsf_arch_text_region_t * next
Definition vsf_arch_abstraction.h:61
uintptr_t size
Definition vsf_arch_abstraction.h:63
uintptr_t start
Definition vsf_arch_abstraction.h:62
Definition vsf_arch_abstraction.h:469
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(bswap_64)
vsf_vplt_info_t info
Definition vsf_arch_abstraction.h:470
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(bswap_16)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(bswap_32)
Definition vsf_arch_abstraction.h:54
void(* leave)(vsf_protect_t orig)
Definition vsf_arch_abstraction.h:56
vsf_protect_t(* enter)(void)
Definition vsf_arch_abstraction.h:55
Definition vsf_cfg.h:95
uint_fast32_t bswap_32(uint_fast32_t)
Definition cortex_a_generic.c:160
vsf_err_t vsf_swi_init(uint_fast8_t idx, vsf_arch_prio_t priority, vsf_swi_handler_t *handler, void *param)
Definition vsf_arch_abstraction.c:508
const vsf_protect_region_t vsf_protect_region_int
Definition vsf_arch_abstraction.c:188
uint_fast8_t vsf_clz32(uint_fast32_t)
Definition vsf_arch_abstraction.c:340
uintalu_t vsf_protect_t
Definition vsf_arch_abstraction.h:53
int_fast8_t vsf_ffs32(uint_fast32_t)
Definition vsf_arch_abstraction.c:409
const vsf_protect_region_t vsf_protect_region_none
Definition vsf_arch_abstraction.c:193
void vsf_arch_shutdown(void)
Definition cortex_m_generic.c:402
void vsf_arch_heap_free(void *buffer)
Definition linux_generic.c:567
unsigned int vsf_arch_heap_alignment(void)
Definition linux_generic.c:573
void vsf_arch_reset(void)
Definition cortex_m_generic.c:396
#define DECLARE_ENDIAN_FUNC(__bitlen)
Definition vsf_arch_abstraction.h:191
void * vsf_arch_heap_malloc(uint_fast32_t size, uint_fast32_t alignment)
Definition linux_generic.c:519
vsf_gint_state_t vsf_disable_interrupt(void)
Definition arm9_generic.c:176
vsf_irq_handler_t vsf_swi_handler_t
Definition vsf_arch_abstraction.h:51
vsf_arch_prio_t vsf_get_base_priority(void)
Definition cortex_m_generic.c:262
vsf_gint_state_t vsf_get_interrupt(void)
Definition arm9_generic.c:164
void vsf_arch_main(void)
void * vsf_arch_heap_realloc(void *buffer, uint_fast32_t size)
Definition linux_generic.c:542
void vsf_swi_trigger(uint_fast8_t idx)
Definition vsf_arch_abstraction.c:466
void vsf_irq_handler_t(void *p)
Definition vsf_arch_abstraction.h:50
void vsf_arch_heap_statistics(vsf_arch_heap_statistics_t *statistics)
Definition common.c:108
void vsf_arch_sleep(uint_fast32_t mode)
Definition cortex_m_generic.c:380
__VSF_VPLT_DECORATOR__ vsf_arch_vplt_t vsf_arch_vplt
Definition vsf_arch_abstraction.c:1091
void vsf_arch_swi_trigger(uint_fast8_t idx)
trigger a software interrupt !
Definition cortex_m_generic.c:242
uint_fast16_t bswap_16(uint_fast16_t)
Definition cortex_a_generic.c:155
vsf_gint_state_t vsf_enable_interrupt(void)
Definition arm9_generic.c:181
uint_fast32_t vsf_arch_heap_size(void *buffer)
Definition linux_generic.c:578
vsf_arch_prio_t vsf_set_base_priority(vsf_arch_prio_t priority)
Definition cortex_m_generic.c:267
int_fast8_t vsf_msb32(uint_fast32_t)
Definition vsf_arch_abstraction.c:375
int vsf_get_interrupt_id(void)
Definition cortex_m_generic.c:370
vsf_gint_state_t vsf_set_interrupt(vsf_gint_state_t level)
Definition arm9_generic.c:169
int_fast8_t vsf_ffz32(uint_fast32_t)
Definition vsf_arch_abstraction.c:444
vk_av_control_value_t value
Definition vsf_audio.h:171
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165
uint_fast32_t alignment
Definition vsf_heap.h:135
uint32_t size
Definition vsf_memfs.h:50