ia64/xen-unstable

changeset 14164:2cc8c117b7b8

[TOOLS] Add support for XEN_ELFNOTE_L1_MFN_VALID to readnotes.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Tue Feb 27 15:39:08 2007 +0000 (2007-02-27)
parents dd8c88744433
children e506c3fd03c9
files tools/xcutils/readnotes.c
line diff
     1.1 --- a/tools/xcutils/readnotes.c	Tue Feb 27 14:33:07 2007 +0000
     1.2 +++ b/tools/xcutils/readnotes.c	Tue Feb 27 15:39:08 2007 +0000
     1.3 @@ -31,6 +31,28 @@ static void print_numeric_note(const cha
     1.4  	       prefix, 2+2*descsz, value, descsz);
     1.5  }
     1.6  
     1.7 +static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
     1.8 +				    const elf_note *note)
     1.9 +{
    1.10 +	int descsz = elf_uval(elf, note, descsz);
    1.11 +	const uint32_t *desc32 = elf_note_desc(elf, note);
    1.12 +	const uint64_t *desc64 = elf_note_desc(elf, note);
    1.13 +
    1.14 +	/* XXX should be able to cope with a list of values. */
    1.15 +	switch ( descsz / 2 )
    1.16 +	{
    1.17 +	case 8:
    1.18 +		printf("%s: mask=%#"PRIx64" value=%#"PRIx64"\n", prefix,
    1.19 +		       desc64[0], desc64[1]);
    1.20 +		break;
    1.21 +	case 4:
    1.22 +		printf("%s: mask=%#"PRIx32" value=%#"PRIx32"\n", prefix,
    1.23 +		       desc32[0],desc32[1]);
    1.24 +		break;
    1.25 +	}
    1.26 +
    1.27 +}
    1.28 +
    1.29  static int print_notes(struct elf_binary *elf, const elf_note *start, const elf_note *end)
    1.30  {
    1.31  	const elf_note *note;
    1.32 @@ -79,7 +101,10 @@ static int print_notes(struct elf_binary
    1.33  			print_string_note("FEATURES", elf , note);
    1.34  			break;
    1.35  		case XEN_ELFNOTE_HV_START_LOW:
    1.36 -			print_numeric_note("HV_START_LOW", elf, note);
    1.37 +			print_numeric_note("HV_START_LOW", elf , note);
    1.38 +			break;
    1.39 +		case XEN_ELFNOTE_L1_MFN_VALID:
    1.40 +			print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
    1.41  			break;
    1.42  		default:
    1.43  			printf("unknown note type %#x\n",