Skip to content

Commit

Permalink
[Review] libutee: add headers for user-space to access sysregs
Browse files Browse the repository at this point in the history
Comments.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
  • Loading branch information
b49020 committed Jul 22, 2019
1 parent fa020f7 commit ae40f7d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
1 change: 0 additions & 1 deletion core/arch/arm/arm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ ifneq ($(filter ta_arm32,$(ta-targets)),)
CFG_ARM32_ta_arm32 := y
arch-bits-ta_arm32 := 32
ta_arm32-platform-cppflags += $(arm32-platform-cppflags)
ta_arm32-platform-cppflags += -I$(out-dir)/core/include/generated/
ta_arm32-platform-cflags += $(arm32-platform-cflags)
ta_arm32-platform-cflags += $(platform-cflags-optimization)
ta_arm32-platform-cflags += $(platform-cflags-debug-info)
Expand Down
13 changes: 13 additions & 0 deletions lib/libutee/arch/arm/arm32_user_sysreg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format of file
# <reg-name> <CRn> <opc1> <CRm> <opc2> <Type> <Description>
# lines beginning with '@' will be printed as additional comments

@ Based on register description in
@ ARM Architecture Reference Manual
@ ARMv7-A and ARMv7-R edition
@ Issue C.c
@

@ B8.2 Generic Timer registers summary
CNTFRQ c14 0 c0 0 RW Counter Frequency register
CNTPCT - 0 c14 - RO Physical Count register
2 changes: 1 addition & 1 deletion lib/libutee/include/arm_user_sysreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <util.h>

#ifdef ARM32
#include <arm32_sysreg.h>
#include <arm32_user_sysreg.h>
#endif

#ifdef ARM64
Expand Down
29 changes: 28 additions & 1 deletion ta/ta.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@ aflags$(sm) := $(platform-aflags) $($(sm)-platform-aflags)
cppflags$(sm) += -include $(conf-file)
cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

ifeq ($(ta-target),ta_arm32)
arm32-user-sysreg-txt = lib/libutee/arch/arm/arm32_user_sysreg.txt
arm32-user-sysregs-$(arm32-user-sysreg-txt)-h := arm32_user_sysreg.h
arm32-user-sysregs += $(arm32-user-sysreg-txt)

arm32-user-sysregs-out := $(out-dir)/include/generated

define process-arm32-user-sysreg
FORCE-GENSRC$(sm): $$(arm32-user-sysregs-out)/$$(arm32-user-sysregs-$(1)-h)
cleanfiles := $$(cleanfiles) \
$$(arm32-user-sysregs-out)/$$(arm32-user-sysregs-$(1)-h)

$$(arm32-user-sysregs-out)/$$(arm32-user-sysregs-$(1)-h): \
$(1) scripts/arm32_sysreg.py
@$(cmd-echo-silent) ' GEN $$@'
$(q)mkdir -p $$(dir $$@)
$(q)scripts/arm32_sysreg.py --guard __$$(arm32-user-sysregs-$(1)-h) \
< $$< > $$@

endef #process-arm32-user-sysreg

$(foreach sr, $(arm32-user-sysregs), \
$(eval $(call process-arm32-user-sysreg,$(sr))))

cppflags$(sm) += -I$(arm32-user-sysregs-out)
endif

base-prefix := $(sm)-

libname = utils
Expand Down Expand Up @@ -98,7 +125,7 @@ incfiles-extra-host += core/include/tee/tee_fs_key_manager.h
incfiles-extra-host += core/include/tee/fs_htree.h
incfiles-extra-host += core/include/signed_hdr.h
ifeq ($(ta-target),ta_arm32)
incfiles-extra-host += $(out-dir)/core/include/generated/arm32_sysreg.h
incfiles-extra-host += $(out-dir)/include/generated/arm32_user_sysreg.h
endif

#
Expand Down

0 comments on commit ae40f7d

Please sign in to comment.