Skip to content

Commit

Permalink
Efiwrapper: fasboot support crashdump to nvme
Browse files Browse the repository at this point in the history
Signed-off-by: Haoyu Tang <[email protected]>
Signed-off-by: Bo He <[email protected]>
  • Loading branch information
haoyu-tang authored and bhe4 committed Sep 5, 2024
1 parent 26de357 commit 7f34bb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion drivers/nvme/NvmExpressBlockIo.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,10 @@ NvmeBlockIoWriteBlocks (
if (MediaId != Media->MediaId)
return EFI_MEDIA_CHANGED;

if (Buffer == NULL)
#ifndef __CRASH_DUMP // crash dump will dump from the address 0
if (Buffer == NULL) //remove this check, allow to write content of zero address to nvme
return EFI_INVALID_PARAMETER;
#endif

if (BufferSize == 0)
return EFI_SUCCESS;
Expand Down
1 change: 1 addition & 0 deletions drivers/nvme/NvmExpressPassthru.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ NvmExpressPassThru (
Status = EFI_SUCCESS;
else {
Status = EFI_DEVICE_ERROR;
DEBUG_NVME ((EFI_D_ERROR, "NvmExpressPassThru:Cq->Sct = %d, Cq->Sc = %d\n",Cq->Sct,Cq->Sc ));
//
// Copy the Respose Queue entry for this command to the callers response buffer
//
Expand Down
6 changes: 5 additions & 1 deletion libefiwrapper/diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ diskio_write(_EFI_DISK_IO *This,
unsigned char *buf = Buffer, *block;
media_t *media;

if (!This || !Buffer)
#ifndef __CRASH_DUMP
if (!This && !Buffer)
#else // crash dump need dump the address 0
if (!This)
#endif
return EFI_INVALID_PARAMETER;

if (!diskio->media)
Expand Down

0 comments on commit 7f34bb3

Please sign in to comment.