Skip to content

Commit

Permalink
Add definition of cpsr hyp mode and ns hypervisor configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jigi-kim committed Apr 6, 2018
1 parent c5878ae commit b34e5e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/arch/arm/include/arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#define ARM32_CPSR_MODE_SVC 0x13
#define ARM32_CPSR_MODE_MON 0x16
#define ARM32_CPSR_MODE_ABT 0x17
#define ARM32_CPSR_MODE_HYP 0x1a
#define ARM32_CPSR_MODE_UND 0x1b
#define ARM32_CPSR_MODE_SYS 0x1f

Expand Down
1 change: 1 addition & 0 deletions core/arch/arm/include/arm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define CPSR_MODE_SVC ARM32_CPSR_MODE_SVC
#define CPSR_MODE_MON ARM32_CPSR_MODE_MON
#define CPSR_MODE_ABT ARM32_CPSR_MODE_ABT
#define CPSR_MODE_HYP ARM32_CPSR_MODE_HYP
#define CPSR_MODE_UND ARM32_CPSR_MODE_UND
#define CPSR_MODE_SYS ARM32_CPSR_MODE_SYS

Expand Down
5 changes: 4 additions & 1 deletion core/arch/arm/kernel/generic_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ __weak void init_sec_mon(unsigned long nsec_entry)
/* Initialize secure monitor */
nsec_ctx = sm_get_nsec_ctx();
nsec_ctx->mon_lr = nsec_entry;
#ifdef CFG_NS_HYPERVISOR
nsec_ctx->mon_spsr = CPSR_MODE_HYP | CPSR_I;
#else
nsec_ctx->mon_spsr = CPSR_MODE_SVC | CPSR_I;

#endif
}
#endif

Expand Down

0 comments on commit b34e5e5

Please sign in to comment.