Skip to contentSkip to conversation

- Update function prototype for sn_io_addr

PATCH In review Jack Steiner 4 participants 5 messages Jul 23, 2004 – Jul 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - Update function prototype for sn_io_addr

Add "const" to function prototype for sn_io_addr. Cuts boot time on simulator in half.

Index: linux/include/asm-ia64/sn/sn2/io.h =================================--- linux.orig/include/asm-ia64/sn/sn2/io.h +++ linux/include/asm-ia64/sn/sn2/io.h
@@ -9,7 +9,7 @@
#ifndef _ASM_SN_SN2_IO_H
#define _ASM_SN_SN2_IO_H

-extern void * sn_io_addr(unsigned long port); /* Forward definition */
+extern void * sn_io_addr(unsigned long port) __attribute__ ((__const__)); /* Forward definition */
extern void sn_mmiob(void); /* Forward definition */
#include <asm/intrinsics.h>

Signature · 4 lines
Thanks

Jack Steiner ([email protected])          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jack Steiner

Jack> Add "const" to function prototype for sn_io_addr. Cuts boot Jack> time on simulator in half.

Jack> Signed-off-by: Jack Steiner <[email protected]>

  Jack> __attribute__ ((__const__));

I think you're supposed to use __attribute_const__.

	--david
#2 lore raw
In reply to Jack Steiner
Quoted 10 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jack Steiner

Jack> Add "const" to function prototype for sn_io_addr. Cuts boot Jack> time on simulator in half.

Jack> Signed-off-by: Jack Steiner <[email protected]>

  Jack> __attribute__ ((__const__));

I think you're supposed to use __attribute_const__.

Right..

Add "const" to function prototype for sn_io_addr. Cuts boot time on simulator in half.

Index: linux/include/asm-ia64/sn/sn2/io.h =================================--- linux.orig/include/asm-ia64/sn/sn2/io.h +++ linux/include/asm-ia64/sn/sn2/io.h
@@ -8,10 +8,11 @@

#ifndef _ASM_SN_SN2_IO_H
#define _ASM_SN_SN2_IO_H
+#include <linux/compiler.h>
+#include <asm/intrinsics.h>

-extern void * sn_io_addr(unsigned long port); /* Forward definition */ +extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
extern void sn_mmiob(void); /* Forward definition */
-#include <asm/intrinsics.h>

#define __sn_mf_a() ia64_mfa()

Signature · 4 lines
Thanks

Jack Steiner ([email protected])          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.
#3 lore raw
In reply to Jack Steiner
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jack" = Jack Steiner <[email protected]> writes:

Jack> Add "const" to function prototype for sn_io_addr. Cuts boot time Jack> on simulator in half.

Is this the SKI simulator? I can't currently build Linux in CONFIG_GENERIC mode to run on the simulator (you can't build the bootloader, and if you work around that by compiling the bootloader
with CONFIG_HP_SIM the result hangs in very early boot). And
sn_io_addr isn't included if you compile with CONFIG_HP_SIM.

So I'm interested to know what you're doing.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au The technical we do immediately, the political takes *forever*