Skip to contentSkip to conversation

Should #ifdef __KERNEL__ be added before #include <spaces.h> in asm-mips/addrspace.h ?

DISCUSSION Song Wang 2 participants 3 messages Jul 21, 2004 – Aug 25, 2004 MIPS

lore
Share & tools
lore

Song Wang

author
#0 lore raw

Hi, Ralf

Should #ifdef _KERNEL__ be added before #include
<spaces.h> in asm-mips/addrspace.h?

I think the reason is the same as when you added
the #ifdef __KERNEL__ before #include <spaces.h>
for asm-mips/page.h.

-Song

__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

#1 lore raw
Quoted 6 lines · Song Wang

Should #ifdef _KERNEL__ be added before #include
<spaces.h> in asm-mips/addrspace.h?

I think the reason is the same as when you added
the #ifdef __KERNEL__ before #include <spaces.h>
for asm-mips/page.h.

Some userspace software is expecting to get PAGE_SHIFT, PAGE_SIZE and PAGE_MASK to be available in userspace via <asm/page.h>, so I protected the inclusion of <asm/spaces.h> with __KERNEL__ but left the definitions of these symbols unprotected.

Ralf

author
#2 lore raw

Ralf,

The problem in asm-mips/addrspace.h when including <spaces.h> is different. The problem is the path.

spaces.h lives in asm-mips/mach-generic,

Only when compiling kernel, asm-mips/mach-generic is in the include path, because arch/mips/Makefile defines it.

However, when compiling the user-space apps, they don't know how to find spaces.h when they indirectly include <asm/addrspace.h>

-Song

Quoted 18 lines · --- Ralf Baechle
Quoted 6 lines · Song Wang

Should #ifdef _KERNEL__ be added before #include
<spaces.h> in asm-mips/addrspace.h?

I think the reason is the same as when you added
the #ifdef __KERNEL__ before #include <spaces.h>
for asm-mips/page.h.

Some userspace software is expecting to get
PAGE_SHIFT, PAGE_SIZE and
PAGE_MASK to be available in userspace via
<asm/page.h>, so I
protected the inclusion of <asm/spaces.h> with
__KERNEL__ but left
the definitions of these symbols unprotected.

Quoted 2 lines

Ralf

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail