Skip to contentSkip to conversation

xen kernel headers: circular dependencies

DISCUSSION Christoph Egger 2 participants 2 messages Mar 28, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I just uncovered a circular header dependency starting from _PAGE_NX.

_PAGE_NX is defined in asm-x86/x86_{64,32}/page.h and uses cpu_has_nx cpu_has_nx is defined in asm-x86/cpufeature.h.

So make asm-x86/x86_{64,32}/page.h include <asm/cpufeature.h>

cpufeature.h uses boot_cpu_data which is declared in asm-x86/processor.h

So make cpufeature.h include <asm/processor.h>

processor.h uses NCAPINTS which is defined in cpufeature.h

processor.h already includes cpufeature.h

gcc fails to build with complaining about implicit declaration of function 'get_cpu_info' then.

Any suggestions on how to fix this?

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#1 lore raw
Quoted 7 lines · Christoph Egger

Hi,

I just uncovered a circular header dependency starting from _PAGE_NX.

Any suggestions on how to fix this?

Well the circular definition itself was okay because _PAGE_NX is a macro which doesn't require immediate inclusion of cpufeature.h.

However _PAGE_NX is itself a bit gross, and most users can just have at _PAGE_NX_BIT directly. So as a cleanup I've now got rid of _PAGE_NX in c/s 23107.

-- Keir

Quoted 2 lines

Christoph