Bug 17373 - 'sparc_cpu_model' inconsistently available for sparc32 and sparc64
Summary: 'sparc_cpu_model' inconsistently available for sparc32 and sparc64
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 6.2
Hardware: sparc
OS: Linux
Target Milestone: ---
Assignee: David Miller
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-09-09 02:47 UTC by Paul Kronenwetter
Modified: 2008-05-01 15:37 UTC (History)
0 users

Clone Of:
Last Closed: 2000-09-16 22:00:08 UTC

Attachments (Terms of Use)

Description Paul Kronenwetter 2000-09-09 02:47:23 UTC
When compiling sane-1.0.3 for sparc (32) one of the source files (sanei/sanei_ab306.c) includes asm/io.h, which in turn includes 
asm-sparc/io.h.  One of the inlines in asm-sparc/io.h is mapioaddr and it references sparc_cpu_model.  This reference is *not* contained within 
an #ifdef __KERNEL__/#endif pair.  However, in asm-sparc/system.h, the definition of sparc_cpu_model *is* protected by #ifdef __KERNEL__ 
and is thus, unavailable for asm-sparc/io.h to use.

Under sparc64, the sparc_cpu_model definition is *not* protected, so things work fine for folks who are fortunate enough to have Ultras!

The definitions should be consistent, either protect under sparc64 or un-protect in sparc32.


Comment 1 David Miller 2000-09-17 01:59:17 UTC
Any program using asm/io.h in userland programs on Sparc needs to be fixed.
Nothing which happens in that header file is appropriate for userland at all,
I/O is done via mmap() of a device and the macros in io.h on Sparc would
not work outside of the kernel.

I'll fix the kernel headers, but SANE needs to be fixed here instead. 

Comment 2 Paul Kronenwetter 2000-09-17 03:38:59 UTC
I think SANE will be fine once the declarations are straightened out.  I don't
believe that SANE actually uses "bad" stuff from the file, but we'll see after
the fix.


Note You need to log in before you can comment on or make changes to this bug.