On 10/20/17 18:52, Ard Biesheuvel wrote:
> On 20 October 2017 at 17:51, Laszlo Ersek <[email protected]> wrote:
>> On 10/20/17 18:39, Ard Biesheuvel wrote:
>>> On 20 October 2017 at 17:37, Gao, Liming <[email protected]> wrote:
>>>> Ard:
>>>>   This case is to share the same value between PeiCore and SecCore. I also 
>>>> think it will be better to define one fixed PCD in MdeModulePkg.dec for 
>>>> this value. Could you submit bugzillar to catch this issue first?
>>>>
>>>
>>> Certainly!
>>
>> Would it be possible to define the PCD as UINT32, and task 64-bit SEC
>> (and PEI_CORE) code to first construct the wider value manually (in a
>> register or otherwise)?
>>
>> Just thinking out loud.
>>
> 
> Could you think the reasoning behind that out loud as well?

Haha, good stab :) Sure.

In your patch you have:

+#define INIT_CAR_VALUE      0x5AA55AA55AA55AA5

for 64-bit, and

+#define INIT_CAR_VALUE      0x5AA55AA5

for 32-bit.

Both 64-bit assembly code in SEC, and 64-bit C-code in the PEI_CORE, can
easily compose the large value from the small value, starting from
FixedPcdGet32(). The alternatives are:

- asking the 32-bit assembly code to truncate the 64-bit constant -- it
won't compile,

- defining *two* FixedAtBuild PCDs, one for 32-bit, another for 64-bit
SEC -- an idea probably not universally liked.

... When I originally started writing my previous email, I even thought
about introducing the PCD as UINT16 :) But then I realized, if any
platform lacks *some* 32-bit mode when it sets up the stack in assembly,
for C-language entry, then the platform won't be supported by edk2.

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to