#=============================================================================== # # Component SConscript # # GENERAL DESCRIPTION # Generic script to load *.scons files. # # Copyright (c) 2009-2017 by QUALCOMM Technologies, Incorporated. # All Rights Reserved. # QUALCOMM Proprietary/GTDR # #------------------------------------------------------------------------------- # # $Header: $ # $DateTime: $ # $Author: $ # $Change: $ # EDIT HISTORY FOR FILE # # This section contains comments describing changes made to the module. # Notice that changes are listed in reverse chronological order. # # when who what, where, why # -------- --- --------------------------------------------------------- # 2017-01-10 sm Initial revision. #=============================================================================== Import('env') env = env.Clone() #------------------------------------------------------------------------------- # Enable werror #------------------------------------------------------------------------------- env.Append(CFLAGS = " -Werror ") # Deploy this directory. env.Deploy(["ssg.scons","ssg.api"]) if not env.IsKeyEnable(['TZOS_IMAGE','TZTESTEXEC_IMAGE']): env.LoadSoftwareUnits() Return() cur_key = 'TZOS_IMAGE' if env.IsKeyEnable('TZOS_IMAGE') else 'TZTESTEXEC_IMAGE' SRCPATH = "." env.VariantDir('${BUILDPATH}', SRCPATH, duplicate=0) #we generate a header with the prototype for the tzbsp_syscall lookup and place it into $BUILDPATH. #The consumer(s) of tzbsp_syscall_def_autogen.h dont know where that header is located, so we append #the path to CPPPATH here, then walk the tree env.Append(CPPPATH=env.RealPath('$BUILDPATH')) env.LoadSoftwareUnits() CBSP_APIS = [ 'BUSES', 'DAL', 'DEBUGTOOLS', 'HAL', 'SERVICES', 'SYSTEMDRIVERS', 'KERNEL', ] env.RequirePublicApi(CBSP_APIS, area = 'core') SSG_API = [ 'QSEE', 'SECUREMSM', 'MON_CALL', 'TZCHIPSET', 'SSGPLATFORM_SERVICES', ] env.RequirePublicApi(SSG_API, area = 'ssg') env.RequireRestrictedApi(SSG_API) prefix = ''' // Copyright (c) 2019 Qualcomm Technologies, Inc. All Rights Reserved. // Qualcomm Technologies Proprietary and Confidential. //AUTOGENERATED. DO NOT MODIFY. modify ssg/build/ssg.scons instead ''' if cur_key == 'TZOS_IMAGE': c_file_prefix = prefix + ''' #include #include "tzbsp_syscall.h" #include "tzbsp_smc.h" #include "mink_services.h" #include "svc_to_hyp.h" #include "tzbsp_syscall_priv.h" #include "IxErrno.h" ''' suffix='' else: #tztestexec uses the legacy definitons of TZBSP_DEFINE_SYSCALL to actually create the tzbsp_syscall_def_autogen.c file #we've redefined these to assert(0) in the headers so that people won't accidently use them, so we need to undef #them here and redefine them to actually output the correct data structure c_file_prefix = prefix + ''' #include #include "tzbsp_syscall.h" #include "tzbsp_smc.h" #include "mink_services.h" #include "tzbsp_syscall_test.h" #include "IxErrno.h" #ifdef TZBSP_DEFINE_SYSCALL #undef TZBSP_DEFINE_SYSCALL #define TZBSP_DEFINE_SYSCALL(mink_service, smc_id, param_id, flags, func) \ extern int func ();\ static tzbsp_syscall_entry_t tz_syscall_entry_ ##func \ __attribute__((section("_tz_syscall"),used)) = \ { mink_service, smc_id, param_id, flags, func } #endif #ifdef TZBSP_DEFINE_WEAK_SYSCALL #undef TZBSP_DEFINE_WEAK_SYSCALL #define TZBSP_DEFINE_WEAK_SYSCALL(mink_service, smc_id, param_id, flags, func) \ extern int func () __attribute__((weak));\ static tzbsp_syscall_entry_t tz_syscall_entry_ ##func \ __attribute__((section("_tz_syscall"),used)) = \ { mink_service, smc_id, param_id, flags, func} #endif ''' suffix='' header_text = prefix + ''' #pragma once int tzbsp_syscall_lookup_new(uintnt smc_id, tzbsp_syscall_entry_t* ret); ''' header = env.Textfile(target='$BUILDPATH/tzbsp_syscall_def_autogen.h', source=header_text) syscall_def = env.GenerateTZBSPSyscallDef(target='${BUILDPATH}/tzbsp_syscall_def_autogen.c', source=env.SyscallListAsBuilderSource(cur_key == 'TZOS_IMAGE', c_file_prefix,env['TZBSP_SYSCALLS'][cur_key],suffix)) env.AddObject(cur_key, syscall_def)