Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36018 )
Change subject: x86 gdb: Extend GDB stub with CPUID command ......................................................................
x86 gdb: Extend GDB stub with CPUID command
Add CPUID command to GDB stub.
NOT FOR MERGE!!!
Change-Id: I49a18c1fff01a139352acbac98a927f213ebcaa6 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/arch/x86/exception.c 1 file changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/36018/1
diff --git a/src/arch/x86/exception.c b/src/arch/x86/exception.c index 7d10c3e..4759015 100644 --- a/src/arch/x86/exception.c +++ b/src/arch/x86/exception.c @@ -602,6 +602,26 @@ break; case 'q': /* query */ break; + case 'u': + /* uAA..AA: Execute CPUID with EAX given by AA..AA. */ + ptr = &in_buffer[1]; + if (parse_ulong(&ptr, &addr) && + (*(ptr++) == ':')) { + char *out_ptr = out_buffer; + struct cpuid_result result; + + result = cpuid(addr); + copy_to_hex(out_ptr, (void *)&(result.eax), 4); + out_ptr += (4 << 1); + copy_to_hex(out_ptr, (void *)&(result.ebx), 4); + out_ptr += (4 << 1); + copy_to_hex(out_ptr, (void *)&(result.ecx), 4); + out_ptr += (4 << 1); + copy_to_hex(out_ptr, (void *)&(result.edx), 4); + out_ptr += (4 << 1); + } else + memcpy(out_buffer, "E07", 4); + break; case 'z': /* z0AAAA,LLLL remove memory breakpoint */ /* z1AAAA,LLLL remove hardware breakpoint */ /* z2AAAA,LLLL remove write watchpoint */