From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web12.1442.1635804743058817842 for ; Mon, 01 Nov 2021 15:12:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=E/QuHoox; spf=pass (domain: nuviainc.com, ip: 209.85.214.174, mailfrom: rebecca@nuviainc.com) Received: by mail-pl1-f174.google.com with SMTP id o14so2767528plg.5 for ; Mon, 01 Nov 2021 15:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G/Zc5NwaIPQow79ZGlaeXdpbn5XpAEggY1DVdGxwp8w=; b=E/QuHooxHYglnp2q0CxyPv5LJldkq3VoLHEhEnciTG6tvCa588q7UPqBwUmtvXmOws NcrPCiOMVIo8XblYIQpcI2Y0UBirzSSHSZoLOjiJOmTuURMh2G8FZ+vntssgl60aLGHO KyE+qdnS423RSX8NccRzCDtRPg+xV4GdXLolGT7tothAXiw4lYUjSm1CW2fUK41jo37n Tbez+wzMkVUaIwhd089Kng7xAmMqfDmXGAORIi6gVze1XoXzR8zzq2jLlhzMq8hsFW4R NF8apwWdm04VuzWn9ZNzLnDhINtbVKUDGVZGN1DOsQULiQ+H2nOxy2SrAE3q6HVgPi7t a+/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G/Zc5NwaIPQow79ZGlaeXdpbn5XpAEggY1DVdGxwp8w=; b=BdxCNY2hgt42ap2rean3Y8cDy9HPBy7iTG697I5GhP328YTtAItrmWmJwFgWoo2iXS giMDska6sq7gNCNmeeymTHx5V+iP0rAqIrbbLn9wy5nWFXrKdsjPr9Vzk/9OX7EDheSh 4/yDsmvOjo3oqZ0/uYB9clXnERG1UO4Fgz5s1YOOIkLHTN/VVJNlFOueYO3+8ZQxDxRT tdN/Zsi0plty7UFAU9Y9fM41zxar3I5crq7MLRv65pD/1y5v/SJokfQg2KxOtX7AXvLe 8g9CsQmsz2plz7N2QMMfcMmj+lnfw7Cyiw4UBLiQMXrmNoaB1Ehq+9FKOOutTCLYb5y5 RMnw== X-Gm-Message-State: AOAM533HKYnJVn1c8PjUDKakIzZre4C4rpsZ4IZ7h/qJZVzgjqjEzXSc miCkxz8ewOKW5m+EYnypOIR8eZRjjnGhwQmKpu2doL/NJql7CRkH7anREuU/nxGhD4OV9/M6qvB rfghbsPn28/gwXdBYRYzs/M4lOBydYErjSPwEqE2gERHKQSgOPjQF35jo8jJoJLajKNBhsg== X-Google-Smtp-Source: ABdhPJy28GXwOX2JUgi+Q3WmYYXZboPxpoDMH1ajUwP4587R838xpYxaTPyiiv0kJJrdYMLSQocOQg== X-Received: by 2002:a17:90b:1c07:: with SMTP id oc7mr1843634pjb.127.1635804742173; Mon, 01 Nov 2021 15:12:22 -0700 (PDT) Return-Path: Received: from linbox.ba.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id z10sm17028455pfh.106.2021.11.01.15.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 15:12:21 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Sami Mujawar , Ard Biesheuvel , Gerd Hoffmann , Samer El-Haj-Mahmoud , Leif Lindholm Cc: Rebecca Cran Subject: [PATCH v2 2/2] ArmPkg: Update SMC calls to use the new ArmCallSmc1/2/3/4 functions Date: Mon, 1 Nov 2021 16:11:53 -0600 Message-Id: <20211101221153.18620-3-rebecca@nuviainc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101221153.18620-1-rebecca@nuviainc.com> References: <20211101221153.18620-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit New SMC helper functions have been added to reduce the amount of template code. Update ArmSmcPsciResetSystemLib and Smbios/ProcessorSubClassDxe to use them. Signed-off-by: Rebecca Cran --- ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c | 10 ++----- ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 31 ++++++++------------ 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c index 8b5ff5c27e44..319f05c9f1e2 100644 --- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c @@ -31,11 +31,8 @@ ResetCold ( VOID ) { - ARM_SMC_ARGS ArmSmcArgs; - // Send a PSCI 0.2 SYSTEM_RESET command - ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET; - ArmCallSmc (&ArmSmcArgs); + ArmCallSmc0 (ARM_SMC_ID_PSCI_SYSTEM_RESET, NULL, NULL, NULL); } /** @@ -66,11 +63,8 @@ ResetShutdown ( VOID ) { - ARM_SMC_ARGS ArmSmcArgs; - // Send a PSCI 0.2 SYSTEM_OFF command - ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF; - ArmCallSmc (&ArmSmcArgs); + ArmCallSmc0 (ARM_SMC_ID_PSCI_SYSTEM_OFF, NULL, NULL, NULL); } /** diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c index d644cd33d249..c6d41e3984f8 100644 --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c @@ -88,22 +88,19 @@ HasSmcArm64SocId ( VOID ) { - ARM_SMC_ARGS Args; INT32 SmcCallStatus; BOOLEAN Arm64SocIdSupported; + UINTN SmcParam; Arm64SocIdSupported = FALSE; - Args.Arg0 = SMCCC_VERSION; - ArmCallSmc (&Args); - SmcCallStatus = (INT32)Args.Arg0; + SmcCallStatus = ArmCallSmc0 (SMCCC_VERSION, NULL, NULL, NULL); if (SmcCallStatus < 0 || (SmcCallStatus >> 16) >= 1) { - Args.Arg0 = SMCCC_ARCH_FEATURES; - Args.Arg1 = SMCCC_ARCH_SOC_ID; - ArmCallSmc (&Args); + SmcParam = SMCCC_ARCH_SOC_ID; + SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_FEATURES, &SmcParam, NULL, NULL); - if (Args.Arg0 >= 0) { + if (SmcCallStatus >= 0) { Arm64SocIdSupported = TRUE; } } @@ -125,30 +122,26 @@ SmbiosGetSmcArm64SocId ( OUT INT32 *SocRevision ) { - ARM_SMC_ARGS Args; INT32 SmcCallStatus; EFI_STATUS Status; + UINTN SmcParam; Status = EFI_SUCCESS; - Args.Arg0 = SMCCC_ARCH_SOC_ID; - Args.Arg1 = 0; - ArmCallSmc (&Args); - SmcCallStatus = (INT32)Args.Arg0; + SmcParam = 0; + SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); if (SmcCallStatus >= 0) { - *Jep106Code = (INT32)Args.Arg0; + *Jep106Code = (INT32)SmcParam; } else { Status = EFI_UNSUPPORTED; } - Args.Arg0 = SMCCC_ARCH_SOC_ID; - Args.Arg1 = 1; - ArmCallSmc (&Args); - SmcCallStatus = (INT32)Args.Arg0; + SmcParam = 1; + SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); if (SmcCallStatus >= 0) { - *SocRevision = (INT32)Args.Arg0; + *SocRevision = (INT32)SmcParam; } else { Status = EFI_UNSUPPORTED; } -- 2.31.1