Chao,
Thanks for providing such a cleaner lib API.
Only 2 comments in below:

> +
> +#define EFI_MEMORY_CACHETYPE_MASK  (EFI_MEMORY_UC  | \
> +                                    EFI_MEMORY_WC  | \
> +                                    EFI_MEMORY_WT  | \
> +                                    EFI_MEMORY_WB  | \
> +                                    EFI_MEMORY_UCE   \
> +                                    )

1. Why do you need to define the EFI_MEMORY_CACHETYPE_MASK here?
Can you just mention that the following APIs only return 5 bits: UC/WC/WT/WB/UCE
without defining the EFI_MEMORY_CACHETYPE_MASK?

> +
> +typedef struct {
> +  EFI_PHYSICAL_ADDRESS    PhysicalBase;
> +  EFI_VIRTUAL_ADDRESS     VirtualBase;
> +  UINTN                   Length;
> +  UINTN                   Attributes;
> +} MEMORY_REGION_DESCRIPTOR;
> +
> +/**
> +  Finds the length and memory properties of the memory region
> corresponding to the specified base address.
> +
> +  @param[in]  BaseAddress    To find the base address of the memory
> region.
> +  @param[in]  EndAddress     To find the end address of the memory
> region.
> +  @param[out]  RegionLength    The length of the memory region
> found.
> +  @param[out]  RegionAttributes    Properties of the memory region
> found.
> +
> +  @retval  EFI_SUCCESS    The corresponding memory area was
> successfully found
> +           EFI_NOT_FOUND    No memory area found
> +**/
> +EFI_STATUS
> +EFIAPI
> +GetMemoryRegionAttributes (
> +  IN     UINTN  BaseAddress,
> +  IN     UINTN  EndAddress,
> +  OUT    UINTN  *RegionLength,
> +  OUT    UINTN  *RegionAttributes
> +  );

2. If the actual memory ranges are as follows:
[0 - 1M, UC]
[1M - 1G, WB]

What's the result of following call:
a. GetMemoryRegionAttributes (512KB, 1MB)
b. GetMemoryRegionAttributes (512KB, 2MB)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112466): https://edk2.groups.io/g/devel/message/112466
Mute This Topic: https://groups.io/mt/103129095/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to