Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1055 → Rev 1056

/shark/trunk/config/config.mk
59,8 → 59,9
CFG_VIDEO_OPT += -DCONFIG_FB_VGA16
endif
 
C_WARN = -Wimplicit-function-declaration -Wall
C_FLAGS = -O -fno-builtin -nostdinc
# for managing gcc4 warnings, added -Wno-attributes -Wno-pointer-sign
C_WARN = -Wimplicit-function-declaration -Wno-attributes -Wno-pointer-sign -Wall
C_FLAGS = -O -fno-builtin -nostdinc -minline-all-stringops
C_INC = $(INCL) $(OTHERINCL) -I$(OSLIB)
C_MAC = $(CFG_OPT)
 
/shark/trunk/oslib/ll/i386/x-bios.h
45,10 → 45,10
WORD _pad __attribute__ ((packed));
} x __attribute__ ((packed));
struct {
BYTE al,ah __attribute__ ((packed));
BYTE bl,bh __attribute__ ((packed));
BYTE cl,ch __attribute__ ((packed));
BYTE dl,dh __attribute__ ((packed));
BYTE al,ah __attribute__ ((packed));
BYTE bl,bh __attribute__ ((packed));
BYTE cl,ch __attribute__ ((packed));
BYTE dl,dh __attribute__ ((packed));
} h __attribute__ ((packed));
} X_REGS16;
 
/shark/trunk/oslib/ll/i386/mem.h
136,6 → 136,7
}
 
#define __HAVE_ARCH_MEMCPY
 
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy((t),(f),(n)) : \
/shark/trunk/oslib/ll/i386/hw-data.h
64,8 → 64,8
typedef struct gate {
WORD offset_lo __attribute__ ((packed));
WORD sel __attribute__ ((packed));
BYTE dword_cnt __attribute__ ((packed));
BYTE access __attribute__ ((packed));
BYTE dword_cnt __attribute__ ((packed));
BYTE access __attribute__ ((packed));
WORD offset_hi __attribute__ ((packed));
} GATE;
 
72,10 → 72,10
typedef struct descriptor {
WORD lim_lo __attribute__ ((packed));
WORD base_lo __attribute__ ((packed));
BYTE base_med __attribute__ ((packed));
BYTE access __attribute__ ((packed));
BYTE gran __attribute__ ((packed));
BYTE base_hi __attribute__ ((packed));
BYTE base_med __attribute__ ((packed));
BYTE access __attribute__ ((packed));
BYTE gran __attribute__ ((packed));
BYTE base_hi __attribute__ ((packed));
} DESCRIPTOR;
 
/* A LDT/GDT entry could be a gate or a selector */
200,7 → 200,7
WORD trap __attribute__ ((packed));
WORD io_base __attribute__ ((packed));
DWORD control __attribute__ ((packed));
BYTE ctx_FPU[FPU_CONTEXT_SIZE] __attribute__ ((packed));
BYTE ctx_FPU[FPU_CONTEXT_SIZE] __attribute__ ((packed));
} TSS;
 
/* Irq services specifications */
/shark/trunk/oslib/libc/reboot.c
70,6 → 70,6
for(j = 0; j < 100000 ; j++);
}
/* That didn't work - force a triple fault.. */
__asm__ __volatile__("lidt %0": :"m" (no_idt));
__asm__ __volatile__("int3");
// __asm__ __volatile__("lidt %0": :"m" (no_idt));
// __asm__ __volatile__("int3");
}
/shark/trunk/oslib/config.mk
40,7 → 40,7
CFG_OPT += -D__OLD_TRACER__
endif
 
C_OPT = -Wall -O -fno-builtin -nostdinc $(CFG_OPT) -DMAIN=__kernel_init__ -I$(INCL)
C_OPT = -Wall -O -fno-builtin -nostdinc -Wno-attributes -Wno-pointer-sign -minline-all-stringops $(CFG_OPT) -DMAIN=__kernel_init__ -I$(INCL)
ASM_OPT = -x assembler-with-cpp $(CFG_OPT) -I$(INCL)
LINK_OPT = -Bstatic -Ttext $(MEM_START) -s -nostartfiles -nostdlib -L$(LIB_PATH)
 
/shark/trunk/drivers/bttv/include/drivers/bttvp.h
248,7 → 248,6
/* our devices */
#define BTTV_MAX 16
extern unsigned int bttv_num;
extern struct bttv bttvs[BTTV_MAX];
 
#define BTTV_MAX_FBUF 0x208000
#define VBIBUF_SIZE (2048*VBI_MAXLINES*2)
377,6 → 376,9
struct bttv_fh init;
};
 
// moved here for gcc4 compatibility
extern struct bttv bttvs[BTTV_MAX];
 
/* private ioctls */
#define BTTV_VERSION _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
#define BTTV_VBISIZE _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
/shark/trunk/drivers/fb/vgastate.c
367,7 → 367,10
if (saved == NULL)
return 1;
memset (saved, 0, sizeof(struct regstate));
(struct regstate *) state->vidstate = saved;
// changed for gcc4 compatibility
//(struct regstate *) state->vidstate = saved;
state->vidstate = (struct regstate *) (saved);
if (state->flags & VGA_SAVE_CMAP) {
saved->vga_cmap = vmalloc(768);
/shark/trunk/drivers/fb/riva/fbdev.c
501,8 → 501,15
u32 b, m, tmp;
 
for (i = 0; i < h; i++) {
b = *((u32 *)data)++;
m = *((u32 *)mask)++;
// changed for gcc4 compatibility
//b = *((u32 *)data)++;
b = *((u32 *)data);
data += sizeof(u32);
//m = *((u32 *)mask)++;
m = *((u32 *)mask);
mask += sizeof(u32);
reverse_order(&b);
for (j = 0; j < w/2; j++) {
1443,7 → 1450,12
while (size >= 16) {
RIVA_FIFO_FREE(par->riva, Bitmap, 16);
for (i = 0; i < 16; i++) {
tmp = *((u32 *)cdat)++;
// changed for gcc4 compatibility
//tmp = *((u32 *)cdat)++;
tmp = *((u32 *)(cdat));
tmp += sizeof(u32);
reverse_order(&tmp);
d[i] = tmp;
}
1452,7 → 1464,12
if (size) {
RIVA_FIFO_FREE(par->riva, Bitmap, size);
for (i = 0; i < size; i++) {
tmp = *((u32 *) cdat)++;
// changed for gcc4 compatibility
//tmp = *((u32 *) cdat)++;
tmp = *((u32 *)(cdat));
tmp += sizeof(u32);
reverse_order(&tmp);
d[i] = tmp;
}
/shark/trunk/drivers/fb/radeonfb.c
1599,7 → 1599,9
if (CRTC_CRT_ON & tmp)
value |= 0x02;
 
(__u32*)arg = value;
// changed for gcc4 compatibility
//(__u32*)arg = value;
arg = (__u32*)(value);
return 0;
default:
return -EINVAL;
/shark/trunk/drivers/fb/matrox/matroxfb_base.h
421,7 → 421,8
} output;
};
 
extern struct display fb_display[];
// removed for gcc4 compatibility (btw, never used within this driver)
//extern struct display fb_display[];
 
struct matrox_switch;
struct matroxfb_driver;
/shark/trunk/drivers/fb/cfbimgblt.c
140,8 → 140,10
if (pitch_index) {
dst2 += p->fix.line_length;
dst1 = (char *) dst2;
(unsigned long) dst1 &= ~(sizeof(u32) - 1);
 
// changed for gcc4 compatibility
dst1 = (unsigned long)(dst1) & ~(sizeof(u32) - 1);
 
start_index += pitch_index;
start_index &= 32 - 1;
}
206,8 → 208,10
if (pitch_index) {
dst2 += pitch;
dst1 = (char *) dst2;
(unsigned long) dst1 &= ~(sizeof(u32) - 1);
 
// changed for gcc4 compatibility
dst1 = (unsigned long)(dst1) & ~(sizeof(u32) - 1);
 
start_index += pitch_index;
start_index &= 32 - 1;
}
/shark/trunk/drivers/usb/input/hid-core.c
604,7 → 604,11
case 2:
if ((end - start) < 2)
return NULL;
item->data.u16 = le16_to_cpu(get_unaligned(((__u16*)start)++));
// changed for gcc4 compatibility
//item->data.u16 = le16_to_cpu(get_unaligned(((__u16*)start)++));
item->data.u16 = le16_to_cpu(get_unaligned(((__u16*)start)));
start += sizeof(u16);
return start;
 
case 3:
611,7 → 615,11
item->size++;
if ((end - start) < 4)
return NULL;
item->data.u32 = le32_to_cpu(get_unaligned(((__u32*)start)++));
// changed for gcc4 compatibility
//item->data.u32 = le32_to_cpu(get_unaligned(((__u32*)start)++));
item->data.u32 = le32_to_cpu(get_unaligned(((__u32*)start)));
start += sizeof(u32);
return start;
}
 
/shark/trunk/drivers/input/shark/shark_keymap.c
27,7 → 27,8
 
static unsigned char actualMap;
 
static KEYB_MAP keyMaps[] = {
// made non-static for gcc4 compatibility
KEYB_MAP keyMaps[] = {
/* US International Map */
{ FALSE,
/* Plain Map */
/shark/trunk/drivers/linuxc26/include/linux/byteorder/swab.h
128,7 → 128,7
#endif /* OPTIMIZE */
 
 
static __inline__ __const__ __u16 __fswab16(__u16 x)
static __inline__ __attribute__((const)) __u16 __fswab16(__u16 x)
{
return __arch__swab16(x);
}
141,7 → 141,7
__arch__swab16s(addr);
}
 
static __inline__ __const__ __u32 __fswab32(__u32 x)
static __inline__ __attribute__((const)) __u32 __fswab32(__u32 x)
{
return __arch__swab32(x);
}
155,7 → 155,7
}
 
#ifdef __BYTEORDER_HAS_U64__
static __inline__ __const__ __u64 __fswab64(__u64 x)
static __inline__ __attribute__((const)) __u64 __fswab64(__u64 x)
{
# ifdef __SWAB_64_THRU_32__
__u32 h = x >> 32;
/shark/trunk/drivers/linuxc26/include/linux/fb.h
512,7 → 512,6
 
/* drivers/video/modedb.c */
#define VESA_MODEDB_SIZE 34
extern const struct fb_videomode vesa_modes[];
 
/* drivers/video/fbcmap.c */
extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
539,6 → 538,9
u32 vmode;
};
 
// moved here for gcc4 compatibility
extern const struct fb_videomode vesa_modes[];
 
#ifdef MODULE
static inline int fb_find_mode(struct fb_var_screeninfo *var,
struct fb_info *info, const char *mode_option,
/shark/trunk/drivers/linuxc26/include/linux/rcupdate.h
111,6 → 111,7
 
static inline int rcu_pending(int cpu)
{
/*
if ((!list_empty(&RCU_curlist(cpu)) &&
rcu_batch_before(RCU_batch(cpu), rcu_ctrlblk.curbatch)) ||
(list_empty(&RCU_curlist(cpu)) &&
119,6 → 120,8
return 1;
else
return 0;
*/
return(1);
}
 
#define rcu_read_lock() preempt_disable()
/shark/trunk/drivers/linuxc26/include/linux/i2c.h
23,7 → 23,7
/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
Frodo Looijaard <frodol@dds.nl> */
 
/* $Id: i2c.h,v 1.1 2004-01-28 15:25:29 giacomo Exp $ */
/* $Id: i2c.h,v 1.2 2006-09-20 05:28:07 tullio Exp $ */
 
#ifndef _LINUX_I2C_H
#define _LINUX_I2C_H
53,10 → 53,6
extern int i2c_master_send(struct i2c_client *,const char* ,int);
extern int i2c_master_recv(struct i2c_client *,char* ,int);
 
/* Transfer num messages.
*/
extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
 
/*
* Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor.
* This is not tested/implemented yet and will change in the future.
188,37 → 184,6
}
 
/*
* The following structs are for those who like to implement new bus drivers:
* i2c_algorithm is the interface to a class of hardware solutions which can
* be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
* to name two of the most common.
*/
struct i2c_algorithm {
char name[32]; /* textual description */
unsigned int id;
 
/* If an adapter algorithm can't to I2C-level access, set master_xfer
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[],
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data * data);
 
/* --- these optional/future use for some adapter types.*/
int (*slave_send)(struct i2c_adapter *,char*,int);
int (*slave_recv)(struct i2c_adapter *,char*,int);
 
/* --- ioctl like call to set div. parameters. */
int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
 
/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
 
/*
* i2c_adapter is the structure used to identify a physical i2c bus along
* with the access algorithms necessary to access it.
*/
401,6 → 366,42
__u8 *buf; /* pointer to msg data */
};
 
// moved here for gcc4 compatibility
/* Transfer num messages. */
extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
 
// moved here for gcc4 compatibility
/*
* The following structs are for those who like to implement new bus drivers:
* i2c_algorithm is the interface to a class of hardware solutions which can
* be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
* to name two of the most common.
*/
struct i2c_algorithm {
char name[32]; /* textual description */
unsigned int id;
 
/* If an adapter algorithm can't to I2C-level access, set master_xfer
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[],
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data * data);
 
/* --- these optional/future use for some adapter types.*/
int (*slave_send)(struct i2c_adapter *,char*,int);
int (*slave_recv)(struct i2c_adapter *,char*,int);
 
/* --- ioctl like call to set div. parameters. */
int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
 
/* To determine what the adapter supports */
u32 (*functionality) (struct i2c_adapter *);
};
 
/* To determine what functionality is present */
 
#define I2C_FUNC_I2C 0x00000001
/shark/trunk/drivers/linuxc26/include/asm/byteorder.h
10,7 → 10,7
#include <linux/config.h>
#endif
 
static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
static __inline__ __attribute__((const)) __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
26,7 → 26,7
 
/* gcc should generate this for open coded C now too. May be worth switching to
it because inline assembly cannot be scheduled. -AK */
static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
static __inline__ __attribute__((const)) __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */
: "=q" (x)
/shark/trunk/drivers/linuxc26/include/asm/processor.h
83,7 → 83,6
 
extern struct cpuinfo_x86 boot_cpu_data;
extern struct cpuinfo_x86 new_cpu_data;
extern struct tss_struct init_tss[NR_CPUS];
extern struct tss_struct doublefault_tss;
 
#ifdef CONFIG_SMP
403,6 → 402,9
unsigned long stack[64];
} __attribute__((packed));
 
// moved here for gcc4 compatibility
extern struct tss_struct init_tss[NR_CPUS];
 
struct thread_struct {
/* cached TLS descriptors. */
struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
/shark/trunk/drivers/linuxc26/videodev.c
355,8 → 355,8
//up(&videodev_lock);
}
 
 
static struct file_operations video_fops=
// removed "static" for gcc 4x compatibility
struct file_operations video_fops=
{
.owner = THIS_MODULE,
.llseek = no_llseek,
/shark/trunk/drivers/linuxc26/waitqueue.c
49,7 → 49,8
 
}
 
void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
{
unsigned long flags;
 
63,7 → 64,8
list_add(&new->task_list, &head->task_list);
}
 
void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
 
73,7 → 75,8
spin_unlock_irqrestore(&q->lock, flags);
}
 
void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
{
unsigned long flags;
 
/shark/trunk/drivers/linuxc26/linuxcomp.c
241,7 → 241,8
 
unsigned long pci_mem_start = 0x10000000;
 
signed long schedule_timeout(signed long timeout)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) signed long schedule_timeout(signed long timeout)
{
struct timespec t,s,e;
 
335,13 → 336,15
init_waitqueue_head(&x->wait);
}
 
void complete(struct completion *x)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) void complete(struct completion *x)
{
x->done++;
__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, 0);
}
 
void wait_for_completion(struct completion *x)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) void wait_for_completion(struct completion *x)
{
spin_lock_irq(&x->wait.lock);
if (!x->done) {
465,7 → 468,8
 
struct page *mem_map = 0x0000;
 
int schedule_work(struct work_struct *work)
// added __attribute__ for gcc4 compatibility
__attribute__((regparm(3))) int schedule_work(struct work_struct *work)
{
return 0;
}