From 2dd7ea9b7a34fd02c10b67bccebfb3c04b7ab3bf Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Mar 2017 13:50:51 +0000 Subject: patch up C99isms and a missing define --- tboot/txt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tboot/txt.c') diff --git a/tboot/txt.c b/tboot/txt.c index 3f7dcf1..3cafd68 100644 --- a/tboot/txt.c +++ b/tboot/txt.c @@ -561,6 +561,7 @@ bool txt_prepare_cpu(void) { unsigned long cr0; uint64_t mcg_cap, mcg_stat, msr_efer, rflags; + unsigned int i; /* must be running at CPL 0 => this is implicit in even getting this far */ /* since our bootstrap code loads a GDT, etc. */ @@ -631,7 +632,7 @@ bool txt_prepare_cpu(void) /* check if all machine check regs are clear */ mcg_cap = rdmsr(MSR_MCG_CAP); - for ( unsigned int i = 0; i < (mcg_cap & 0xff); i++ ) { + for ( i = 0; i < (mcg_cap & 0xff); i++ ) { mcg_stat = rdmsr(MSR_MC0_STATUS + 4*i); if ( mcg_stat & (1ULL << 63) ) { printk(TBOOT_ERR"MCG[%u] = %Lx ERROR\n", i, mcg_stat); -- cgit v1.2.3