From 2f4b07b668323122a363eee87a2348f4a738bc8c Mon Sep 17 00:00:00 2001 From: Zhiguang Liu Date: Wed, 17 Jan 2024 11:16:34 +0800 Subject: [PATCH] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap() PageTableMap() only modifies the PageTable root pointer when creating from zero. Explicitly explain it in function header. Reviewed-by: Ray Ni Reviewed-by: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Zhiguang Liu --- UefiCpuPkg/Include/Library/CpuPageTableLib.h | 1 + UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/UefiCpuPkg/Include/Library/CpuPageTableLib.h b/UefiCpuPkg/Include/Library/CpuPageTableLib.h index 6225a1d8e974..cd493ad69ccb 100644 --- a/UefiCpuPkg/Include/Library/CpuPageTableLib.h +++ b/UefiCpuPkg/Include/Library/CpuPageTableLib.h @@ -67,6 +67,7 @@ typedef enum { Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute. @param[in, out] PageTable The pointer to the page table to update, or pointer to NULL if a new page table is to be created. + If not pointer to NULL, the value it points to won't be changed in this function. @param[in] PagingMode The paging mode. @param[in] Buffer The free buffer to be used for page table creation/updating. @param[in, out] BufferSize The buffer size. diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c index ae4caf8dfe60..7c2bd25d22a6 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -640,6 +640,7 @@ PageTableLibMapInLevel ( Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute. @param[in, out] PageTable The pointer to the page table to update, or pointer to NULL if a new page table is to be created. + If not pointer to NULL, the value it points to won't be changed in this function. @param[in] PagingMode The paging mode. @param[in] Buffer The free buffer to be used for page table creation/updating. @param[in, out] BufferSize The buffer size.