File tree Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ add_custom_command(OUTPUT ${CORE_ISA_DM}
59
59
set (ZSR_H ${CMAKE_BINARY_DIR} /zephyr/include/generated/zsr.h )
60
60
add_custom_command (OUTPUT ${ZSR_H} DEPENDS ${CORE_ISA_DM}
61
61
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /gen_zsr.py
62
+ $< $< BOOL:${CONFIG_XTENSA_MMU} > :--mmu>
62
63
${CORE_ISA_DM} ${ZSR_H} )
63
64
add_custom_target (zsr_h DEPENDS ${ZSR_H} )
64
65
add_dependencies (zephyr_interface zsr_h )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
# Copyright (c) 2022 Intel corporation
3
3
# SPDX-License-Identifier: Apache-2.0
4
- import sys
4
+ import argparse
5
5
import re
6
6
7
7
# Scratch register allocator. Zephyr uses multiple Xtensa SRs as
11
11
# -dM") core-isa.h file for the current architecture and assigns
12
12
# registers to usages.
13
13
14
- NEEDED = ("A0SAVE" , "CPU" , "FLUSH" )
14
+ def parse_args ():
15
+ parser = argparse .ArgumentParser (allow_abbrev = False )
15
16
16
- coreisa = sys .argv [1 ]
17
- outfile = sys .argv [2 ]
17
+ parser .add_argument ("--mmu" , action = "store_true" ,
18
+ help = "Enable scratch registers for MMU usage" )
19
+ parser .add_argument ("coreisa" ,
20
+ help = "Path to preprocessed core-isa.h" )
21
+ parser .add_argument ("outfile" ,
22
+ help = "Output file" )
23
+
24
+ return parser .parse_args ()
25
+
26
+ args = parse_args ()
27
+
28
+ NEEDED = ["A0SAVE" , "CPU" , "FLUSH" ]
29
+ if args .mmu :
30
+ NEEDED += ["MMU_0" , "MMU_1" , "DBLEXC" ]
31
+
32
+ coreisa = args .coreisa
33
+ outfile = args .outfile
18
34
19
35
syms = {}
20
36
Original file line number Diff line number Diff line change @@ -439,14 +439,14 @@ _handle_tlb_miss_kernel:
439
439
. global _DoubleExceptionVector
440
440
_DoubleExceptionVector:
441
441
#ifdef CONFIG_XTENSA_MMU
442
- wsr a0 , ZSR_A0SAVE
442
+ wsr a0 , ZSR_DBLEXC
443
443
rsync
444
444
445
445
rsr.exccause a0
446
446
addi a0 , a0 , - EXCCAUSE_DTLB_MISS
447
447
beqz a0 , _handle_tlb_miss_dblexc
448
448
449
- rsr a0 , ZSR_A0SAVE
449
+ rsr a0 , ZSR_DBLEXC
450
450
451
451
j _Level1Vector
452
452
#else
@@ -482,7 +482,7 @@ _handle_tlb_miss_dblexc:
482
482
rsr.ptevaddr a0
483
483
l32i a0 , a0 , 0
484
484
485
- rsr a0 , ZSR_A0SAVE
485
+ rsr a0 , ZSR_DBLEXC
486
486
rfde
487
487
#endif
488
488
.popsection
Original file line number Diff line number Diff line change @@ -558,8 +558,8 @@ _Level\LVL\()VectorHelper :
558
558
_Level \LVL \()Vector :
559
559
#endif
560
560
#ifdef CONFIG_XTENSA_MMU
561
- wsr .ZSR_EXTRA0 a2
562
- wsr .ZSR_EXTRA1 a3
561
+ wsr .ZSR_MMU_0 a2
562
+ wsr .ZSR_MMU_1 a3
563
563
rsync
564
564
565
565
/* Calculations below will clobber registers used.
@@ -579,8 +579,8 @@ _Level\LVL\()Vector:
579
579
rsr .ZSR_CPU a3
580
580
PRELOAD_PTEVADDR a3 , a2
581
581
582
- rsr .ZSR_EXTRA1 a3
583
- rsr .ZSR_EXTRA0 a2
582
+ rsr .ZSR_MMU_1 a3
583
+ rsr .ZSR_MMU_0 a2
584
584
#endif /* CONFIG_XTENSA_MMU */
585
585
addi a1 , a1 , - ___xtensa_irq_bsa_t_SIZEOF
586
586
s32i a0 , a1 , ___xtensa_irq_bsa_t_a0_OFFSET
You can’t perform that action at this time.
0 commit comments