Commit b83cd715 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390: gcc 3.3 adaptions.

updates for compiling with gcc-3.3pre

- add -finline-limit=10000 to make it build
- drop .eh_frame elf section from vmlinux
- fix common warnings inn asm headers
- make dasd compile
- Don't warn about signed/unsigned comparisions
- fix inline syscall macros
parent d70aa010
...@@ -18,7 +18,7 @@ OBJCOPYFLAGS := -O binary ...@@ -18,7 +18,7 @@ OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux := -e start LDFLAGS_vmlinux := -e start
LDFLAGS_BLOB := --format binary --oformat elf32-s390 LDFLAGS_BLOB := --format binary --oformat elf32-s390
CFLAGS += -pipe -fno-strength-reduce CFLAGS += -pipe -fno-strength-reduce -finline-limit=10000 -Wno-sign-compare
head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
......
...@@ -64,6 +64,9 @@ SECTIONS ...@@ -64,6 +64,9 @@ SECTIONS
__setup_start = .; __setup_start = .;
.init.setup : { *(.init.setup) } .init.setup : { *(.init.setup) }
__setup_end = .; __setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__initcall_start = .; __initcall_start = .;
.initcall.init : { .initcall.init : {
*(.initcall1.init) *(.initcall1.init)
...@@ -98,6 +101,7 @@ SECTIONS ...@@ -98,6 +101,7 @@ SECTIONS
*(.exit.text) *(.exit.text)
*(.exit.data) *(.exit.data)
*(.exitcall.exit) *(.exitcall.exit)
*(.eh_frame)
} }
/* Stabs debugging sections. */ /* Stabs debugging sections. */
......
...@@ -19,7 +19,7 @@ LDFLAGS_vmlinux := -e start ...@@ -19,7 +19,7 @@ LDFLAGS_vmlinux := -e start
MODFLAGS += -fpic -D__PIC__ MODFLAGS += -fpic -D__PIC__
LDFLAGS_BLOB := --format binary --oformat elf64-s390 LDFLAGS_BLOB := --format binary --oformat elf64-s390
CFLAGS += -pipe -fno-strength-reduce CFLAGS += -pipe -fno-strength-reduce -finline-limit=10000 -Wno-sign-compare
head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
......
...@@ -64,6 +64,9 @@ SECTIONS ...@@ -64,6 +64,9 @@ SECTIONS
__setup_start = .; __setup_start = .;
.init.setup : { *(.init.setup) } .init.setup : { *(.init.setup) }
__setup_end = .; __setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__initcall_start = .; __initcall_start = .;
.initcall.init : { .initcall.init : {
*(.initcall1.init) *(.initcall1.init)
...@@ -98,6 +101,7 @@ SECTIONS ...@@ -98,6 +101,7 @@ SECTIONS
*(.exit.text) *(.exit.text)
*(.exit.data) *(.exit.data)
*(.exitcall.exit) *(.exitcall.exit)
*(.eh_frame)
} }
/* Stabs debugging sections. */ /* Stabs debugging sections. */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* History of changes * History of changes
* *
...@@ -109,7 +109,7 @@ typedef struct DE_eckd_data_t { ...@@ -109,7 +109,7 @@ typedef struct DE_eckd_data_t {
unsigned char cfw:1; /* Cache fast write */ unsigned char cfw:1; /* Cache fast write */
unsigned char dfw:1; /* DASD fast write */ unsigned char dfw:1; /* DASD fast write */
} __attribute__ ((packed)) attributes; } __attribute__ ((packed)) attributes;
__u16 short blk_size; /* Blocksize */ __u16 blk_size; /* Blocksize */
__u16 fast_write_id; __u16 fast_write_id;
__u8 ga_additional; /* Global Attributes Additional */ __u8 ga_additional; /* Global Attributes Additional */
__u8 ga_extended; /* Global Attributes Extended */ __u8 ga_extended; /* Global Attributes Extended */
......
...@@ -469,7 +469,7 @@ test_and_change_bit_simple(int nr, volatile unsigned long *ptr) ...@@ -469,7 +469,7 @@ test_and_change_bit_simple(int nr, volatile unsigned long *ptr)
* This routine doesn't need to be atomic. * This routine doesn't need to be atomic.
*/ */
static inline int __test_bit(int nr, volatile unsigned long *ptr) static inline int __test_bit(int nr, const volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -480,7 +480,7 @@ static inline int __test_bit(int nr, volatile unsigned long *ptr) ...@@ -480,7 +480,7 @@ static inline int __test_bit(int nr, volatile unsigned long *ptr)
} }
static inline int static inline int
__constant_test_bit(int nr, volatile unsigned long * addr) { __constant_test_bit(int nr, const volatile unsigned long * addr) {
return (((volatile char *) addr)[(nr>>3)^3] & (1<<(nr&7))) != 0; return (((volatile char *) addr)[(nr>>3)^3] & (1<<(nr&7))) != 0;
} }
......
...@@ -191,10 +191,10 @@ static inline int ...@@ -191,10 +191,10 @@ static inline int
__idal_buffer_is_needed(struct idal_buffer *ib) __idal_buffer_is_needed(struct idal_buffer *ib)
{ {
#ifdef CONFIG_ARCH_S390X #ifdef CONFIG_ARCH_S390X
return ib->size > (4096 << ib->page_order) || return ib->size > (4096ul << ib->page_order) ||
idal_is_needed(ib->data[0], ib->size); idal_is_needed(ib->data[0], ib->size);
#else #else
return ib->size > (4096 << ib->page_order); return ib->size > (4096ul << ib->page_order);
#endif #endif
} }
......
...@@ -266,27 +266,29 @@ do { \ ...@@ -266,27 +266,29 @@ do { \
#define _syscall0(type,name) \ #define _syscall0(type,name) \
type name(void) { \ type name(void) { \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name) \ : "i" (__NR_##name) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall1(type,name,type1,arg1) \ #define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) { \ type name(type1 arg1) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1) \ "0" (__arg1) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -294,15 +296,16 @@ type name(type1 arg1) { \ ...@@ -294,15 +296,16 @@ type name(type1 arg1) { \
type name(type1 arg1, type2 arg2) { \ type name(type1 arg1, type2 arg2) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2) \ "d" (__arg2) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -311,16 +314,17 @@ type name(type1 arg1, type2 arg2, type3 arg3) { \ ...@@ -311,16 +314,17 @@ type name(type1 arg1, type2 arg2, type3 arg3) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
"d" (__arg3) \ "d" (__arg3) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -331,17 +335,18 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ ...@@ -331,17 +335,18 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register type4 __arg4 asm("5") = arg4; \ register type4 __arg4 asm("5") = arg4; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
"d" (__arg3), \ "d" (__arg3), \
"d" (__arg4) \ "d" (__arg4) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -354,11 +359,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ ...@@ -354,11 +359,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register type4 __arg4 asm("5") = arg4; \ register type4 __arg4 asm("5") = arg4; \
register type5 __arg5 asm("6") = arg5; \ register type5 __arg5 asm("6") = arg5; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
...@@ -366,6 +371,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ ...@@ -366,6 +371,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
"d" (__arg4), \ "d" (__arg4), \
"d" (__arg5) \ "d" (__arg5) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
......
...@@ -473,7 +473,7 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr) ...@@ -473,7 +473,7 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
* This routine doesn't need to be atomic. * This routine doesn't need to be atomic.
*/ */
static inline int __test_bit(unsigned long nr, volatile unsigned long *ptr) static inline int __test_bit(unsigned long nr, const volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -484,7 +484,7 @@ static inline int __test_bit(unsigned long nr, volatile unsigned long *ptr) ...@@ -484,7 +484,7 @@ static inline int __test_bit(unsigned long nr, volatile unsigned long *ptr)
} }
static inline int static inline int
__constant_test_bit(unsigned long nr, volatile unsigned long *addr) { __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0; return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0;
} }
......
...@@ -191,10 +191,10 @@ static inline int ...@@ -191,10 +191,10 @@ static inline int
__idal_buffer_is_needed(struct idal_buffer *ib) __idal_buffer_is_needed(struct idal_buffer *ib)
{ {
#ifdef CONFIG_ARCH_S390X #ifdef CONFIG_ARCH_S390X
return ib->size > (4096 << ib->page_order) || return ib->size > (4096ul << ib->page_order) ||
idal_is_needed(ib->data[0], ib->size); idal_is_needed(ib->data[0], ib->size);
#else #else
return ib->size > (4096 << ib->page_order); return ib->size > (4096ul << ib->page_order);
#endif #endif
} }
......
...@@ -233,27 +233,29 @@ do { \ ...@@ -233,27 +233,29 @@ do { \
#define _syscall0(type,name) \ #define _syscall0(type,name) \
type name(void) { \ type name(void) { \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name) \ : "i" (__NR_##name) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#define _syscall1(type,name,type1,arg1) \ #define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) { \ type name(type1 arg1) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1) \ "0" (__arg1) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -261,15 +263,16 @@ type name(type1 arg1) { \ ...@@ -261,15 +263,16 @@ type name(type1 arg1) { \
type name(type1 arg1, type2 arg2) { \ type name(type1 arg1, type2 arg2) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2) \ "d" (__arg2) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -278,16 +281,17 @@ type name(type1 arg1, type2 arg2, type3 arg3) { \ ...@@ -278,16 +281,17 @@ type name(type1 arg1, type2 arg2, type3 arg3) { \
register type1 __arg1 asm("2") = arg1; \ register type1 __arg1 asm("2") = arg1; \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
"d" (__arg3) \ "d" (__arg3) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -298,17 +302,18 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ ...@@ -298,17 +302,18 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
register type2 __arg2 asm("3") = arg2; \ register type2 __arg2 asm("3") = arg2; \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register type4 __arg4 asm("5") = arg4; \ register type4 __arg4 asm("5") = arg4; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
"d" (__arg3), \ "d" (__arg3), \
"d" (__arg4) \ "d" (__arg4) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
...@@ -321,11 +326,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ ...@@ -321,11 +326,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
register type3 __arg3 asm("4") = arg3; \ register type3 __arg3 asm("4") = arg3; \
register type4 __arg4 asm("5") = arg4; \ register type4 __arg4 asm("5") = arg4; \
register type5 __arg5 asm("6") = arg5; \ register type5 __arg5 asm("6") = arg5; \
register long __res asm("2"); \ register long __svcres asm("2"); \
long __res; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
" svc %b1\n" \ " svc %b1\n" \
" lgr %0,2" \ : "=d" (__svcres) \
: "=d" (__res) \
: "i" (__NR_##name), \ : "i" (__NR_##name), \
"0" (__arg1), \ "0" (__arg1), \
"d" (__arg2), \ "d" (__arg2), \
...@@ -333,6 +338,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ ...@@ -333,6 +338,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
"d" (__arg4), \ "d" (__arg4), \
"d" (__arg5) \ "d" (__arg5) \
: _svc_clobber ); \ : _svc_clobber ); \
__res = __svcres; \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment