The previous version of the macro allows for more false positives
than necessary.
Replace the macro with IS_PSCI_32 and IS_PSCI_UBOOT macros, that
explicitly check for the 32 bit PSCI IDs, and the PSCI 0.1 IDs
used by uboot. ARMv8 will need an additinal check for the IDs
of 64 bit PSCI functions.
Signed-off-by: Antonios Motakis <antonios.motakis@huawei.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
#define PSCI_CPU_IS_ON 0
#define PSCI_CPU_IS_OFF 1
-#define IS_PSCI_FN(hvc) ((((hvc) >> 24) & 0x84) == 0x84)
+#define IS_PSCI_32(hvc) (((hvc) >> 24) == 0x84)
+#define IS_PSCI_UBOOT(hvc) (((hvc) >> 8) == 0x95c1ba)
#define PSCI_INVALID_ADDRESS 0xffffffff
{
unsigned long *regs = ctx->regs;
- if (IS_PSCI_FN(regs[0]))
+ if (IS_PSCI_32(regs[0]) || IS_PSCI_UBOOT(regs[0]))
regs[0] = psci_dispatch(ctx);
else
regs[0] = smc(regs[0], regs[1], regs[2], regs[3]);
{
unsigned long *regs = ctx->regs;
- if (IS_PSCI_FN(regs[0]))
+ if (IS_PSCI_32(regs[0]) || IS_PSCI_UBOOT(regs[0]))
regs[0] = psci_dispatch(ctx);
else
regs[0] = hypercall(regs[0], regs[1], regs[2]);