soc: wch: add generic vector table support
Add `VECTOR_TABLE_SIZE` Kconfig option to define the number of interrupt and exception vectors based on the actual hardware specification. Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
This commit is contained in:
parent
957ec63897
commit
74b502e914
3 changed files with 16 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
# Copyright (c) 2024 Michael Hope
|
# Copyright (c) 2024 Michael Hope
|
||||||
|
# Copyright (c) 2024 Jianxiong Gu
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
config SOC_FAMILY_CH32V
|
config SOC_FAMILY_CH32V
|
||||||
|
@ -10,6 +11,13 @@ config SOC_FAMILY_CH32V
|
||||||
|
|
||||||
if SOC_FAMILY_CH32V
|
if SOC_FAMILY_CH32V
|
||||||
|
|
||||||
|
config VECTOR_TABLE_SIZE
|
||||||
|
int "Number of Interrupt and Exception Vectors"
|
||||||
|
range 20 256
|
||||||
|
help
|
||||||
|
This option defines the total number of interrupt and exception
|
||||||
|
vectors in the vector table.
|
||||||
|
|
||||||
rsource "*/Kconfig"
|
rsource "*/Kconfig"
|
||||||
|
|
||||||
endif # SOC_FAMILY_CH32V
|
endif # SOC_FAMILY_CH32V
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
if SOC_CH32V003
|
if SOC_CH32V003
|
||||||
|
|
||||||
|
config VECTOR_TABLE_SIZE
|
||||||
|
default 38
|
||||||
|
|
||||||
config NUM_IRQS
|
config NUM_IRQS
|
||||||
default 48
|
default 48
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
#include <zephyr/toolchain.h>
|
#include <zephyr/toolchain.h>
|
||||||
|
|
||||||
|
#ifndef CONFIG_VECTOR_TABLE_SIZE
|
||||||
|
#error "VECTOR_TABLE_SIZE must be defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Exports */
|
/* Exports */
|
||||||
GTEXT(__start)
|
GTEXT(__start)
|
||||||
|
|
||||||
|
@ -15,7 +19,7 @@ GTEXT(__initialize)
|
||||||
SECTION_FUNC(vectors, ivt)
|
SECTION_FUNC(vectors, ivt)
|
||||||
.option norvc
|
.option norvc
|
||||||
j __start
|
j __start
|
||||||
.rept 38
|
.rept CONFIG_VECTOR_TABLE_SIZE
|
||||||
.word _isr_wrapper
|
.word _isr_wrapper
|
||||||
.endr
|
.endr
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue