From 482249e79492c694103ea1af5ee3456ae6d96282 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 1 Aug 2010 21:25:08 +0000 Subject: [PATCH] Use standard types Replace uchar, uint, ulong, u_char, u_int, u_long, u_int* with their standard equivalents. Fixes warnings like these on OpenBSD: CC target/arch/unix/unix.o In file included from ../arch/unix/unix.c:29: ../include/config.h:26: warning: redefinition of `ulong' /usr/include/sys/types.h:56: warning: `ulong' previously declared here ../include/config.h:26: warning: redundant redeclaration of `ulong' in same scope Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@830 f158a5a8-5612-0410-a976-696ce0be7e32 --- arch/ppc/briq/init.c | 4 +- arch/ppc/briq/main.c | 10 +-- arch/ppc/briq/methods.c | 12 +-- arch/ppc/mol/init.c | 4 +- arch/ppc/mol/main.c | 50 +++++------ arch/ppc/mol/methods.c | 16 ++-- arch/ppc/mol/mol.h | 2 +- arch/ppc/mol/osi-scsi.c | 2 +- arch/ppc/ofmem.c | 22 ++--- arch/ppc/osi_calls.h | 156 +++++++++++++++++------------------ arch/ppc/pearpc/init.c | 4 +- arch/ppc/pearpc/main.c | 10 +-- arch/ppc/pearpc/methods.c | 12 +-- arch/ppc/qemu/init.c | 4 +- arch/ppc/qemu/kernel.h | 2 +- arch/ppc/qemu/methods.c | 14 ++-- arch/ppc/qemu/ofmem.c | 38 ++++----- arch/ppc/qemu/start.S | 2 +- arch/ppc/start.S | 2 +- arch/sparc32/linux_load.c | 2 +- arch/sparc64/linux_load.c | 2 +- arch/unix/boot.c | 4 +- arch/x86/linux_load.c | 2 +- fs/ext2/ext2_fs.c | 4 +- fs/ext2/ext2_utils.c | 4 +- fs/ext2/ext2_utils.h | 2 +- fs/grubfs/defs.h | 8 -- fs/grubfs/dir.h | 10 +-- fs/grubfs/disk_inode.h | 2 +- fs/grubfs/fs.h | 16 ++-- fs/grubfs/grubfs_fs.c | 8 +- fs/grubfs/iso9660.h | 70 ++++++++-------- fs/hfs/hfs.c | 2 +- fs/hfs/hfs_fs.c | 16 ++-- fs/hfs/include/hfs.h | 2 +- fs/hfs/include/volume.h | 2 +- fs/hfs/volume.c | 2 +- fs/hfs_mdb.h | 34 ++++---- fs/hfsplus/hfsp_fs.c | 4 +- fs/hfsplus/include/volume.h | 2 +- fs/hfsplus/volume.c | 2 +- fs/ioglue.c | 14 ++-- fs/iso9660/iso9660_fs.c | 4 +- fs/iso9660/iso9660_mount.c | 2 +- fs/iso9660/libiso9660.h | 2 +- fs/os.h | 2 +- include/arch/ppc/processor.h | 12 +-- include/config.h | 10 +-- include/fs/fs.h | 20 ++--- include/libc/diskio.h | 4 +- include/libopenbios/ofmem.h | 4 +- libc/diskio.c | 6 +- libopenbios/client.c | 2 +- libopenbios/console_common.c | 10 +-- libopenbios/elf_load.c | 4 +- packages/cmdline.c | 2 +- packages/mac-parts.c | 26 +++--- packages/nvram.c | 12 +-- packages/pc-parts.c | 12 +-- packages/sun-parts.c | 10 +-- packages/video.c | 30 +++---- 61 files changed, 367 insertions(+), 387 deletions(-) diff --git a/arch/ppc/briq/init.c b/arch/ppc/briq/init.c index 3b5672a..14abe96 100644 --- a/arch/ppc/briq/init.c +++ b/arch/ppc/briq/init.c @@ -102,8 +102,8 @@ arch_of_init( void ) if( !(ph=find_dev("/rtas")) ) printk("Warning: No /rtas node\n"); else { - ulong size = 0x1000; - while( size < (ulong)of_rtas_end - (ulong)of_rtas_start ) + unsigned long size = 0x1000; + while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start ) size *= 2; set_property( ph, "rtas-size", (char*)&size, sizeof(size) ); } diff --git a/arch/ppc/briq/main.c b/arch/ppc/briq/main.c index 6f7d408..fbb2a26 100644 --- a/arch/ppc/briq/main.c +++ b/arch/ppc/briq/main.c @@ -26,9 +26,9 @@ #include "libopenbios/ofmem.h" static void -transfer_control_to_elf( ulong entry ) +transfer_control_to_elf( unsigned long entry ) { - extern void call_elf( ulong entry ); + extern void call_elf( unsigned long entry ); printk("Starting ELF image at 0x%08lX\n", entry); call_elf( 0x400000 ); //call_elf( entry ); @@ -37,7 +37,7 @@ transfer_control_to_elf( ulong entry ) } static int -load_elf_rom( ulong *entry, int fd ) +load_elf_rom( unsigned long *entry, int fd ) { int i, lszz_offs, elf_offs; char buf[128], *addr; @@ -91,7 +91,7 @@ load_elf_rom( ulong *entry, int fd ) flush_icache_range( addr, addr+s ); /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n", - (ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/ + (unsigned long)phdr[i].p_vaddr, (unsigned long)phdr[i].p_memsz );*/ } free( phdr ); return lszz_offs; @@ -115,7 +115,7 @@ briq_startup( void ) { const char *paths[] = { "hd:0,\\zImage.chrp", NULL }; const char *args[] = { "root=/dev/hda2 console=ttyS0,115200", NULL }; - ulong entry; + unsigned long entry; int i, fd; for( i=0; paths[i]; i++ ) { diff --git a/arch/ppc/briq/methods.c b/arch/ppc/briq/methods.c index 85c8397..9978f04 100644 --- a/arch/ppc/briq/methods.c +++ b/arch/ppc/briq/methods.c @@ -37,7 +37,7 @@ rtas_instantiate( void ) { int physbase = POP(); int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start; - ulong virt; + unsigned long virt; while( s < size ) s += 0x1000; @@ -137,10 +137,10 @@ DECLARE_NODE( ciface, 0, 0, "/packages/client-iface" ); /* ( -- ) */ static void -ciface_quiesce( ulong args[], ulong ret[] ) +ciface_quiesce( unsigned long args[], unsigned long ret[] ) { #if 0 - ulong msr; + unsigned long msr; /* This seems to be the correct thing to do - but I'm not sure */ asm volatile("mfmsr %0" : "=r" (msr) : ); msr &= ~(MSR_IR | MSR_DR); @@ -151,11 +151,11 @@ ciface_quiesce( ulong args[], ulong ret[] ) /* ( -- ms ) */ static void -ciface_milliseconds( ulong args[], ulong ret[] ) +ciface_milliseconds( unsigned long args[], unsigned long ret[] ) { extern unsigned long get_timer_freq(); - static ulong mticks=0, usecs=0; - ulong t; + static unsigned long mticks=0, usecs=0; + unsigned long t; asm volatile("mftb %0" : "=r" (t) : ); if( mticks ) diff --git a/arch/ppc/mol/init.c b/arch/ppc/mol/init.c index ab9c409..3d24352 100644 --- a/arch/ppc/mol/init.c +++ b/arch/ppc/mol/init.c @@ -97,8 +97,8 @@ arch_of_init( void ) if( (ph=prom_find_device("/rtas")) == -1 ) printk("Warning: No /rtas node\n"); else { - ulong size = 0x1000; - while( size < (ulong)of_rtas_end - (ulong)of_rtas_start ) + unsigned long size = 0x1000; + while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start ) size *= 2; prom_set_prop( ph, "rtas-size", (char*)&size, sizeof(size) ); } diff --git a/arch/ppc/mol/main.c b/arch/ppc/mol/main.c index c6e7dc0..f6ed934 100644 --- a/arch/ppc/mol/main.c +++ b/arch/ppc/mol/main.c @@ -32,9 +32,9 @@ static void patch_newworld_rom( char *start, size_t size ); static void newworld_timer_hack( char *start, size_t size ); static void -transfer_control_to_elf( ulong entry ) +transfer_control_to_elf( unsigned long entry ) { - extern void call_elf( ulong entry ); + extern void call_elf( unsigned long entry ); printk("Starting ELF boot loader\n"); call_elf( entry ); @@ -42,7 +42,7 @@ transfer_control_to_elf( ulong entry ) } static int -load_elf_rom( ulong *entry, int fd ) +load_elf_rom( unsigned long *entry, int fd ) { int i, lszz_offs, elf_offs; char buf[128], *addr; @@ -95,7 +95,7 @@ load_elf_rom( ulong *entry, int fd ) flush_icache_range( addr, addr+s ); /* printk("ELF ROM-section loaded at %08lX (size %08lX)\n", - (ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/ + (unsigned long)phdr[i].p_vaddr, (unsigned long)phdr[i].p_memsz );*/ } free( phdr ); return lszz_offs; @@ -113,18 +113,18 @@ static void patch_newworld_rom( char *start, size_t size ) { int s; - ulong mark[] = { 0x7c7d1b78, /* mr r29,r3 */ - 0x7c9c2378, /* mr r28,r4 */ - 0x7cc33378, /* mr r3,r6 */ - 0x7c864214, /* add r4,r6,r8 <------ BUG -- */ - 0x80b10000, /* lwz r5,0(r17) */ - 0x38a500e8 }; /* addi r5,r5,232 */ + unsigned long mark[] = { 0x7c7d1b78, /* mr r29,r3 */ + 0x7c9c2378, /* mr r28,r4 */ + 0x7cc33378, /* mr r3,r6 */ + 0x7c864214, /* add r4,r6,r8 <------ BUG -- */ + 0x80b10000, /* lwz r5,0(r17) */ + 0x38a500e8 }; /* addi r5,r5,232 */ /* Correcting add r4,r6,r8 ----> addi r4,r6,8 */ for( s=0; s" @@ -273,10 +273,10 @@ DECLARE_NODE( ciface, 0, 0, "/packages/client-iface" ); /* ( -- ) */ static void -ciface_quiesce( ulong args[], ulong ret[] ) +ciface_quiesce( unsigned long args[], unsigned long ret[] ) { #if 0 - ulong msr; + unsigned long msr; /* This seems to be the correct thing to do - but I'm not sure */ asm volatile("mfmsr %0" : "=r" (msr) : ); msr &= ~(MSR_IR | MSR_DR); @@ -290,10 +290,10 @@ ciface_quiesce( ulong args[], ulong ret[] ) /* ( -- ms ) */ static void -ciface_milliseconds( ulong args[], ulong ret[] ) +ciface_milliseconds( unsigned long args[], unsigned long ret[] ) { - static ulong mticks=0, usecs=0; - ulong t; + static unsigned long mticks=0, usecs=0; + unsigned long t; asm volatile("mftb %0" : "=r" (t) : ); if( mticks ) diff --git a/arch/ppc/mol/mol.h b/arch/ppc/mol/mol.h index 56553bc..e9cbceb 100644 --- a/arch/ppc/mol/mol.h +++ b/arch/ppc/mol/mol.h @@ -21,7 +21,7 @@ extern void init_video( void ); extern int video_get_res( int *w, int *h ); extern void draw_pixel( int x, int y, int colind ); -extern void set_color( int index, ulong color ); +extern void set_color( int index, unsigned long color ); /* console.c */ extern int console_draw_str( const char *str ); diff --git a/arch/ppc/mol/osi-scsi.c b/arch/ppc/mol/osi-scsi.c index d90289f..18f3dc5 100644 --- a/arch/ppc/mol/osi-scsi.c +++ b/arch/ppc/mol/osi-scsi.c @@ -52,7 +52,7 @@ scsi_cmd_( instance_data_t *sd, const char *cmd, int cmdlen, char *dest, /* memset( dest, 0, len ); */ - if( (uint)prelen > sizeof(prebuf) || (uint)postlen > sizeof(postbuf) ) { + if( (unsigned int)prelen > sizeof(prebuf) || (unsigned int)postlen > sizeof(postbuf) ) { printk("bad pre/post len %d %d\n", prelen, postlen ); return 1; } diff --git a/arch/ppc/ofmem.c b/arch/ppc/ofmem.c index 34dc724..436cfe3 100644 --- a/arch/ppc/ofmem.c +++ b/arch/ppc/ofmem.c @@ -37,7 +37,7 @@ /* called from assembly */ extern void dsi_exception( void ); extern void isi_exception( void ); -extern void setup_mmu( ulong code_base, ulong code_size, ulong ramsize ); +extern void setup_mmu( unsigned long code_base, unsigned long code_size, unsigned long ramsize ); /**************************************************************** * Memory usage (before of_quiesce is called) @@ -74,13 +74,13 @@ static ofmem_t s_ofmem; #define IO_BASE 0x80000000 #define OFMEM (&s_ofmem) -static inline ulong +static inline unsigned long get_hash_base( void ) { return HASH_BASE; } -static inline ulong +static inline unsigned long get_hash_size( void ) { return HASH_SIZE; @@ -201,7 +201,7 @@ static void hash_page( ucell ea, ucell phys, ucell mode ) { static int next_grab_slot=0; - ulong *upte, cmp, hash1; + unsigned long *upte, cmp, hash1; int i, vsid, found; mPTE_t *pp; @@ -213,7 +213,7 @@ hash_page( ucell ea, ucell phys, ucell mode ) hash1 &= (get_hash_size() - 1) >> 6; pp = (mPTE_t*)(get_hash_base() + (hash1 << 6)); - upte = (ulong*)pp; + upte = (unsigned long*)pp; /* replace old translation */ for( found=0, i=0; !found && i<8; i++ ) @@ -240,7 +240,7 @@ hash_page( ucell ea, ucell phys, ucell mode ) void dsi_exception( void ) { - ulong dar, dsisr; + unsigned long dar, dsisr; ucell mode; ucell phys; @@ -256,7 +256,7 @@ dsi_exception( void ) void isi_exception( void ) { - ulong nip, srr1; + unsigned long nip, srr1; ucell mode; ucell phys; @@ -275,11 +275,11 @@ isi_exception( void ) /************************************************************************/ void -setup_mmu( ulong code_base, ulong code_size, ulong ramsize ) +setup_mmu( unsigned long code_base, unsigned long code_size, unsigned long ramsize ) { - ulong sdr1 = HASH_BASE | ((HASH_SIZE-1) >> 16); - ulong sr_base = (0x20 << 24) | SEGR_BASE; - ulong msr; + unsigned long sdr1 = HASH_BASE | ((HASH_SIZE-1) >> 16); + unsigned long sr_base = (0x20 << 24) | SEGR_BASE; + unsigned long msr; int i; asm volatile("mtsdr1 %0" :: "r" (sdr1) ); diff --git a/arch/ppc/osi_calls.h b/arch/ppc/osi_calls.h index f6e94a5..1d6b3dc 100644 --- a/arch/ppc/osi_calls.h +++ b/arch/ppc/osi_calls.h @@ -107,7 +107,7 @@ type name( void ) \ #define _osi_call1( type, name, number, type1, arg1 ) \ type name( type1 arg1 ) \ _oc_head( dreg(r6) ) \ - __oc_r6 = (ulong)arg1; \ + __oc_r6 = (unsigned long)arg1; \ _oc_syscall( number ) \ _oc_input( ir(r6) ) \ _oc_tail @@ -115,8 +115,8 @@ type name( type1 arg1 ) \ #define _osi_call2( type, name, number, t1, a1, t2, a2 ) \ type name( t1 a1, t2 a2 ) \ _oc_head( dreg(r6), dreg(r7) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ _oc_syscall( number ) \ _oc_input( ir(r6), ir(r7) ) \ _oc_tail @@ -124,9 +124,9 @@ type name( t1 a1, t2 a2 ) \ #define _osi_call3( type, name, number, t1, a1, t2, a2, t3, a3 ) \ type name( t1 a1, t2 a2, t3 a3 ) \ _oc_head( dreg(r6), dreg(r7), dreg(r8) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ - __oc_r8 = (ulong)a3; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ + __oc_r8 = (unsigned long)a3; \ _oc_syscall( number ) \ _oc_input( ir(r6), ir(r7), ir(r8) ) \ _oc_tail @@ -134,10 +134,10 @@ type name( t1 a1, t2 a2, t3 a3 ) \ #define _osi_call4( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4 ) \ type name( t1 a1, t2 a2, t3 a3, t4 a4 ) \ _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ - __oc_r8 = (ulong)a3; \ - __oc_r9 = (ulong)a4; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ + __oc_r8 = (unsigned long)a3; \ + __oc_r9 = (unsigned long)a4; \ _oc_syscall( number ) \ _oc_input( ir(r6), ir(r7), ir(r8), ir(r9) ) \ _oc_tail @@ -145,11 +145,11 @@ type name( t1 a1, t2 a2, t3 a3, t4 a4 ) \ #define _osi_call5( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4, t5, a5 ) \ type name( t1 a1, t2 a2, t3 a3, t4 a4, t5 a5 ) \ _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9), dreg(r10) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ - __oc_r8 = (ulong)a3; \ - __oc_r9 = (ulong)a4; \ - __oc_r10 = (ulong)a5; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ + __oc_r8 = (unsigned long)a3; \ + __oc_r9 = (unsigned long)a4; \ + __oc_r10 = (unsigned long)a5; \ _oc_syscall( number ) \ _oc_input( ir(r6), ir(r7), ir(r8), ir(r9), ir(r10) ) \ _oc_tail @@ -157,12 +157,12 @@ type name( t1 a1, t2 a2, t3 a3, t4 a4, t5 a5 ) \ #define _osi_call6( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6 ) \ type name( t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6 ) \ _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9), dreg(r10), dreg(r11) )\ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ - __oc_r8 = (ulong)a3; \ - __oc_r9 = (ulong)a4; \ - __oc_r10 = (ulong)a5; \ - __oc_r11 = (ulong)a6; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ + __oc_r8 = (unsigned long)a3; \ + __oc_r9 = (unsigned long)a4; \ + __oc_r10 = (unsigned long)a5; \ + __oc_r11 = (unsigned long)a6; \ _oc_syscall( number ) \ _oc_input( ir(r6), ir(r7), ir(r8), ir(r9), ir(r10), ir(r11) ) \ _oc_tail @@ -186,8 +186,8 @@ type name( type1 retarg1 ) \ _oc_head() \ _oc_syscall( number, rr(r4), rr(r5) ) \ _oc_input() \ - ((ulong*)retarg1)[0] = __oc_r4; \ - ((ulong*)retarg1)[1] = __oc_r5; \ + ((unsigned long*)retarg1)[0] = __oc_r4; \ + ((unsigned long*)retarg1)[1] = __oc_r5; \ _oc_tail /* r4-r8 returned in retarg1 pointer */ @@ -197,68 +197,68 @@ type name( type1 retarg1 ) \ _oc_syscall( number, \ rr(r4), rr(r5), rr(r6), rr(r7), rr(r8) ) \ _oc_input() \ - ((ulong*)retarg1)[0] = __oc_r4; \ - ((ulong*)retarg1)[1] = __oc_r5; \ - ((ulong*)retarg1)[2] = __oc_r6; \ - ((ulong*)retarg1)[3] = __oc_r7; \ - ((ulong*)retarg1)[4] = __oc_r8; \ + ((unsigned long*)retarg1)[0] = __oc_r4; \ + ((unsigned long*)retarg1)[1] = __oc_r5; \ + ((unsigned long*)retarg1)[2] = __oc_r6; \ + ((unsigned long*)retarg1)[3] = __oc_r7; \ + ((unsigned long*)retarg1)[4] = __oc_r8; \ _oc_tail /* r4 returned in retarg pointer */ #define _osi_call1_w1( type, name, number, t1, a1, t2, retarg ) \ type name( t1 a1, t2 retarg ) \ _oc_head( dreg(r6) ) \ - __oc_r6 = (ulong)a1; \ + __oc_r6 = (unsigned long)a1; \ _oc_syscall( number, rr(r4) ) \ _oc_input( ir(r6) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ _oc_tail /* r4,r5 returned in retarg1, retarg2 */ #define _osi_call1_w1w1( type, name, number, t1, a1, t2, retarg1, t3, retarg2 ) \ type name( t1 a1, t2 retarg1, t3 retarg2 ) \ _oc_head( dreg(r6) ) \ - __oc_r6 = (ulong)a1; \ + __oc_r6 = (unsigned long)a1; \ _oc_syscall( number, rr(r4), rr(r5) ) \ _oc_input( ir(r6) ) \ - ((ulong*)retarg1)[0] = __oc_r4; \ - ((ulong*)retarg2)[0] = __oc_r5; \ + ((unsigned long*)retarg1)[0] = __oc_r4; \ + ((unsigned long*)retarg2)[0] = __oc_r5; \ _oc_tail /* r4,r5 returned in retarg1, retarg2, retarg3 */ #define _osi_call1_w1w1w1( type, name, number, t1, a1, t2, retarg1, t3, retarg2, t4, retarg3 ) \ type name( t1 a1, t2 retarg1, t3 retarg2, t4 retarg3 ) \ _oc_head( dreg(r6) ) \ - __oc_r6 = (ulong)a1; \ + __oc_r6 = (unsigned long)a1; \ _oc_syscall( number, rr(r4), rr(r5), rr(r6) ) \ _oc_input( ir(r6) ) \ - ((ulong*)retarg1)[0] = __oc_r4; \ - ((ulong*)retarg2)[0] = __oc_r5; \ - ((ulong*)retarg3)[0] = __oc_r6; \ + ((unsigned long*)retarg1)[0] = __oc_r4; \ + ((unsigned long*)retarg2)[0] = __oc_r5; \ + ((unsigned long*)retarg3)[0] = __oc_r6; \ _oc_tail /* r4,r5 returned in retarg pointer */ #define _osi_call1_w2( type, name, number, t1, a1, t2, retarg ) \ type name( t1 a1, t2 retarg ) \ _oc_head( dreg(r6) ) \ - __oc_r6 = (ulong)a1; \ + __oc_r6 = (unsigned long)a1; \ _oc_syscall( number, rr(r4), rr(r5) ) \ _oc_input( ir(r6) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ - ((ulong*)retarg)[1] = __oc_r5; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[1] = __oc_r5; \ _oc_tail /* r4-r7 returned in retarg pointer */ #define _osi_call1_w4( type, name, number, t1, a1, t2, retarg ) \ type name( t1 a1, t2 retarg ) \ _oc_head( dreg(r6), dreg(r7) ) \ - __oc_r6 = (ulong)a1; \ + __oc_r6 = (unsigned long)a1; \ _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7) ) \ _oc_input( ir(r6) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ - ((ulong*)retarg)[1] = __oc_r5; \ - ((ulong*)retarg)[2] = __oc_r6; \ - ((ulong*)retarg)[3] = __oc_r7; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[1] = __oc_r5; \ + ((unsigned long*)retarg)[2] = __oc_r6; \ + ((unsigned long*)retarg)[3] = __oc_r7; \ _oc_tail @@ -266,26 +266,26 @@ type name( t1 a1, t2 retarg ) \ #define _osi_call2_w2( type, name, number, t1, a1, t2, a2, t3, retarg ) \ type name( t1 a1, t2 a2, t3 retarg ) \ _oc_head( dreg(r6), dreg(r7) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ _oc_syscall( number, rr(r4), rr(r5) ) \ _oc_input( ir(r6), ir(r7) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ - ((ulong*)retarg)[1] = __oc_r5; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[1] = __oc_r5; \ _oc_tail /* r4-r7 returned in retarg pointer */ #define _osi_call2_w4( type, name, number, t1, a1, t2, a2, t3, retarg ) \ type name( t1 a1, t2 a2, t3 retarg ) \ _oc_head( dreg(r6), dreg(r7) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7) ) \ _oc_input( ir(r6), ir(r7) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ - ((ulong*)retarg)[1] = __oc_r5; \ - ((ulong*)retarg)[2] = __oc_r6; \ - ((ulong*)retarg)[3] = __oc_r7; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[1] = __oc_r5; \ + ((unsigned long*)retarg)[2] = __oc_r6; \ + ((unsigned long*)retarg)[3] = __oc_r7; \ _oc_tail #ifdef SHORT_REGLIST @@ -293,9 +293,9 @@ type name( t1 a1, t2 a2, t3 retarg ) \ #define _osi_call2_w6( type, name, number, t1, a1, t2, a2, t3, retarg ) \ type name( t1 a1, t2 a2, t3 retarg ) \ _oc_head( dreg(r6), dreg(r7), dreg(r10) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ - __oc_r10 = (ulong)retarg; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ + __oc_r10 = (unsigned long)retarg; \ _oc_syscall_r10w6( number, ir(r6), ir(r7) ) \ _oc_tail @@ -305,16 +305,16 @@ type name( t1 a1, t2 a2, t3 retarg ) \ #define _osi_call2_w6( type, name, number, t1, a1, t2, a2, t3, retarg ) \ type name( t1 a1, t2 a2, t3 retarg ) \ _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9) ) \ - __oc_r6 = (ulong)a1; \ - __oc_r7 = (ulong)a2; \ + __oc_r6 = (unsigned long)a1; \ + __oc_r7 = (unsigned long)a2; \ _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7), rr(r8), rr(r9) ) \ _oc_input( ir(r6), ir(r7) ) \ - ((ulong*)retarg)[0] = __oc_r4; \ - ((ulong*)retarg)[1] = __oc_r5; \ - ((ulong*)retarg)[2] = __oc_r6; \ - ((ulong*)retarg)[3] = __oc_r7; \ - ((ulong*)retarg)[4] = __oc_r8; \ - ((ulong*)retarg)[5] = __oc_r9; \ + ((unsigned long*)retarg)[0] = __oc_r4; \ + ((unsigned long*)retarg)[1] = __oc_r5; \ + ((unsigned long*)retarg)[2] = __oc_r6; \ + ((unsigned long*)retarg)[3] = __oc_r7; \ + ((unsigned long*)retarg)[4] = __oc_r8; \ + ((unsigned long*)retarg)[5] = __oc_r9; \ _oc_tail #endif /* SHORT_REGLIST */ @@ -332,8 +332,8 @@ static inline _osi_call1( int, OSI_Debugger, OSI_DEBUGGER, int, num ); static inline _osi_call0( int, OSI_Exit, OSI_EXIT ); /* misc */ -static inline _osi_call0( ulong, OSI_GetLocalTime, OSI_GET_LOCALTIME ); -static inline _osi_call0( ulong, OSI_GetGMTTime, OSI_GET_GMT_TIME ); +static inline _osi_call0( unsigned long, OSI_GetLocalTime, OSI_GET_LOCALTIME ); +static inline _osi_call0( unsigned long, OSI_GetGMTTime, OSI_GET_GMT_TIME ); static inline _osi_call1( int, OSI_USleep, OSI_USLEEP, int, usecs ); /* NVRAM */ @@ -378,7 +378,7 @@ static inline _osi_call0( int, OSI_PICGetActiveIRQ, OSI_PIC_GET_ACTIVE_IRQ ); static inline _osi_call1( int, OSI_SoundCntl, OSI_SOUND_CNTL, int, cmd ); static inline _osi_call2( int, OSI_SoundCntl1, OSI_SOUND_CNTL, int, cmd, int, p1 ); static inline _osi_call3( int, OSI_SoundCntl2, OSI_SOUND_CNTL, int, cmd, int, p1, int, p2 ); -static inline _osi_call0_w2( int, OSI_SoundIRQAck, OSI_SOUND_IRQ_ACK, ulong *, timestamp ); +static inline _osi_call0_w2( int, OSI_SoundIRQAck, OSI_SOUND_IRQ_ACK, unsigned long *, timestamp ); static inline _osi_call3( int, OSI_SoundWrite, OSI_SOUND_WRITE, int, physbuf, int, len, int, restart ); static inline _osi_call3( int, OSI_SoundSetVolume, OSI_SOUND_SET_VOLUME, int, hwvol, int, speakervol, int, mute ); @@ -393,9 +393,9 @@ static inline _osi_call3( int, OSI_ABlkRingSetup, OSI_ABLK_RING_SETUP, int, chan static inline _osi_call2( int, OSI_ABlkCntrl, OSI_ABLK_CNTRL, int, channel, int, cmd ); static inline _osi_call3( int, OSI_ABlkCntrl1, OSI_ABLK_CNTRL, int, channel, int, cmd, int, param ); static inline _osi_call5( int, OSI_ABlkSyncRead, OSI_ABLK_SYNC_READ, int, channel, int, unit, - int, blk, ulong, mphys, int, size ); + int, blk, unsigned long, mphys, int, size ); static inline _osi_call5( int, OSI_ABlkSyncWrite, OSI_ABLK_SYNC_WRITE, int, channel, int, unit, - int, blk, ulong, mphys, int, size ); + int, blk, unsigned long, mphys, int, size ); static inline _osi_call2( int, OSI_ABlkBlessDisk, OSI_ABLK_BLESS_DISK, int, channel, int, unit ); static inline _osi_call0( int, OSI_CMountDrvVol, OSI_CMOUNT_DRV_VOL ); @@ -409,15 +409,15 @@ static inline _osi_call2( int, OSI_Enet2Cntrl1, OSI_ENET2_CNTRL, int, cmd, int, static inline _osi_call1( int, OSI_Enet2Cntrl, OSI_ENET2_CNTRL, int, cmd ); static inline _osi_call0( int, OSI_Enet2Kick, OSI_ENET2_KICK ); -static inline _osi_call0_w2( int, OSI_Enet2GetHWAddr__, OSI_ENET2_GET_HWADDR, ulong *, retbuf ); +static inline _osi_call0_w2( int, OSI_Enet2GetHWAddr__, OSI_ENET2_GET_HWADDR, unsigned long *, retbuf ); static inline int OSI_Enet2GetHWAddr( unsigned char *addr ) { int ret; - ulong buf[2]; + unsigned long buf[2]; ret = OSI_Enet2GetHWAddr__( buf ); - ((ulong*)addr)[0] = buf[0]; - ((ushort*)addr)[2] = (buf[1] >> 16); + ((unsigned long*)addr)[0] = buf[0]; + ((unsigned short*)addr)[2] = (buf[1] >> 16); return ret; } static inline _osi_call2( int, OSI_Enet2IRQAck, OSI_ENET2_IRQ_ACK, int, irq_enable, int, rx_head ); @@ -430,12 +430,12 @@ static inline _osi_call5( int, OSI_PromIface3, OSI_PROM_IFACE, int, what, int, p static inline _osi_call2( int, OSI_PromPathIface, OSI_PROM_PATH_IFACE, int, what, const char *, p ); /* emulation acceleration */ -static inline _osi_call1( int, OSI_MapinMregs, OSI_MAPIN_MREGS, ulong, mphys ); +static inline _osi_call1( int, OSI_MapinMregs, OSI_MAPIN_MREGS, unsigned long, mphys ); static inline _osi_call3( int, OSI_EmuAccel, OSI_EMUACCEL, int, emuaccel_flags, int, param, int, inst_addr ); /* timer frequency */ -static inline _osi_call1( int, OSI_MticksToUsecs, OSI_MTICKS_TO_USECS, ulong, mticks ); -static inline _osi_call1( int, OSI_UsecsToMticks, OSI_USECS_TO_MTICKS, ulong, usecs ); +static inline _osi_call1( int, OSI_MticksToUsecs, OSI_MTICKS_TO_USECS, unsigned long, mticks ); +static inline _osi_call1( int, OSI_UsecsToMticks, OSI_USECS_TO_MTICKS, unsigned long, usecs ); /* fb info */ struct osi_fb_info; diff --git a/arch/ppc/pearpc/init.c b/arch/ppc/pearpc/init.c index 85c6a66..55b3aae 100644 --- a/arch/ppc/pearpc/init.c +++ b/arch/ppc/pearpc/init.c @@ -108,8 +108,8 @@ arch_of_init( void ) if( !(ph=find_dev("/rtas")) ) printk("Warning: No /rtas node\n"); else { - ulong size = 0x1000; - while( size < (ulong)of_rtas_end - (ulong)of_rtas_start ) + unsigned long size = 0x1000; + while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start ) size *= 2; set_property( ph, "rtas-size", (char*)&size, sizeof(size) ); } diff --git a/arch/ppc/pearpc/main.c b/arch/ppc/pearpc/main.c index 0d9d061..085494e 100644 --- a/arch/ppc/pearpc/main.c +++ b/arch/ppc/pearpc/main.c @@ -26,9 +26,9 @@ #include "libopenbios/ofmem.h" static void -transfer_control_to_elf( ulong entry ) +transfer_control_to_elf( unsigned long entry ) { - extern void call_elf( ulong entry ); + extern void call_elf( unsigned long entry ); printk("Starting ELF image at 0x%08lX\n", entry); call_elf( 0x400000 ); //call_elf( entry ); @@ -37,7 +37,7 @@ transfer_control_to_elf( ulong entry ) } static int -load_elf_rom( ulong *entry, int fd ) +load_elf_rom( unsigned long *entry, int fd ) { int i, lszz_offs, elf_offs; char buf[128], *addr; @@ -91,7 +91,7 @@ load_elf_rom( ulong *entry, int fd ) flush_icache_range( addr, addr+s ); /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n", - (ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/ + (unsigned long)phdr[i].p_vaddr, (unsigned long)phdr[i].p_memsz );*/ } free( phdr ); return lszz_offs; @@ -115,7 +115,7 @@ pearpc_startup( void ) { const char *paths[] = { "hd:0,\\zImage.chrp", NULL }; const char *args[] = { "root=/dev/hda2 console=ttyS0,115200", NULL }; - ulong entry; + unsigned long entry; int i, fd; for( i=0; paths[i]; i++ ) { diff --git a/arch/ppc/pearpc/methods.c b/arch/ppc/pearpc/methods.c index a798522..bbc88ca 100644 --- a/arch/ppc/pearpc/methods.c +++ b/arch/ppc/pearpc/methods.c @@ -37,7 +37,7 @@ rtas_instantiate( void ) { int physbase = POP(); int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start; - ulong virt; + unsigned long virt; while( s < size ) s += 0x1000; @@ -139,10 +139,10 @@ DECLARE_NODE( ciface, 0, 0, "/packages/client-iface" ); /* ( -- ) */ static void -ciface_quiesce( ulong args[], ulong ret[] ) +ciface_quiesce( unsigned long args[], unsigned long ret[] ) { #if 0 - ulong msr; + unsigned long msr; /* This seems to be the correct thing to do - but I'm not sure */ asm volatile("mfmsr %0" : "=r" (msr) : ); msr &= ~(MSR_IR | MSR_DR); @@ -153,11 +153,11 @@ ciface_quiesce( ulong args[], ulong ret[] ) /* ( -- ms ) */ static void -ciface_milliseconds( ulong args[], ulong ret[] ) +ciface_milliseconds( unsigned long args[], unsigned long ret[] ) { extern unsigned long get_timer_freq(); - static ulong mticks=0, usecs=0; - ulong t; + static unsigned long mticks=0, usecs=0; + unsigned long t; asm volatile("mftb %0" : "=r" (t) : ); if( mticks ) diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index f33c91a..408b23c 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -683,8 +683,8 @@ arch_of_init( void ) if( !(ph=find_dev("/rtas")) ) printk("Warning: No /rtas node\n"); else { - ulong size = 0x1000; - while( size < (ulong)of_rtas_end - (ulong)of_rtas_start ) + unsigned long size = 0x1000; + while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start ) size *= 2; set_property( ph, "rtas-size", (char*)&size, sizeof(size) ); } diff --git a/arch/ppc/qemu/kernel.h b/arch/ppc/qemu/kernel.h index d4d10f2..e8ae364 100644 --- a/arch/ppc/qemu/kernel.h +++ b/arch/ppc/qemu/kernel.h @@ -22,7 +22,7 @@ extern void exit( int status ); /* start.S */ extern void flush_icache_range( char *start, char *stop ); extern char of_rtas_start[], of_rtas_end[]; -extern void call_elf( ulong arg1, ulong arg2, ulong elf_entry ); +extern void call_elf( unsigned long arg1, unsigned long arg2, unsigned long elf_entry ); /* methods.c */ extern void node_methods_init( const char *cpuname ); diff --git a/arch/ppc/qemu/methods.c b/arch/ppc/qemu/methods.c index 0cd71f4..cf307f9 100644 --- a/arch/ppc/qemu/methods.c +++ b/arch/ppc/qemu/methods.c @@ -39,7 +39,7 @@ rtas_instantiate( void ) { ucell physbase = POP(); ucell s=0x1000, size = (ucell)of_rtas_end - (ucell)of_rtas_start; - ulong virt; + unsigned long virt; while( s < size ) s += 0x1000; @@ -110,10 +110,10 @@ DECLARE_NODE( ciface, 0, 0, "+/openprom/client-services" ); /* ( -- ) */ static void -ciface_quiesce( ulong args[], ulong ret[] ) +ciface_quiesce( unsigned long args[], unsigned long ret[] ) { #if 0 - ulong msr; + unsigned long msr; /* This seems to be the correct thing to do - but I'm not sure */ asm volatile("mfmsr %0" : "=r" (msr) : ); msr &= ~(MSR_IR | MSR_DR); @@ -125,10 +125,10 @@ ciface_quiesce( ulong args[], ulong ret[] ) #define TIMER_FREQUENCY 16600000ULL static void -ciface_milliseconds( ulong args[], ulong ret[] ) +ciface_milliseconds( unsigned long args[], unsigned long ret[] ) { - ulong tbu, tbl, temp; - ullong ticks, msecs; + unsigned long tbu, tbl, temp; + unsigned long long ticks, msecs; asm volatile( "1:\n" @@ -141,7 +141,7 @@ ciface_milliseconds( ulong args[], ulong ret[] ) : : "cc"); - ticks = (((ullong)tbu) << 32) | (ullong)tbl; + ticks = (((unsigned long long)tbu) << 32) | (unsigned long long)tbl; msecs = (1000 * ticks) / TIMER_FREQUENCY; PUSH( msecs ); } diff --git a/arch/ppc/qemu/ofmem.c b/arch/ppc/qemu/ofmem.c index 7631a1c..b06cb7e 100644 --- a/arch/ppc/qemu/ofmem.c +++ b/arch/ppc/qemu/ofmem.c @@ -28,7 +28,7 @@ /* called from assembly */ extern void dsi_exception( void ); extern void isi_exception( void ); -extern void setup_mmu( ulong code_base ); +extern void setup_mmu( unsigned long code_base ); /* * From Apple's BootX source comments: @@ -56,43 +56,43 @@ extern void setup_mmu( ulong code_base ); #define SEGR_USER BIT(2) #define SEGR_BASE 0x0400 -static inline ulong +static inline unsigned long get_hash_base( void ) { - ulong sdr1; + unsigned long sdr1; asm volatile("mfsdr1 %0" : "=r" (sdr1) ); return (sdr1 & 0xffff0000); } -static inline ulong +static inline unsigned long get_hash_size( void ) { - ulong sdr1; + unsigned long sdr1; asm volatile("mfsdr1 %0" : "=r" (sdr1) ); return ((sdr1 << 16) | 0x0000ffff) + 1; } -static inline ulong +static inline unsigned long get_rom_base( void ) { ofmem_t *ofmem = ofmem_arch_get_private(); return ofmem->ramsize - 0x00100000; } -ulong +unsigned long get_ram_top( void ) { return get_rom_base() - HASH_SIZE - (32 + 32 + 64) * 1024; } -ulong +unsigned long get_ram_bottom( void ) { - return (ulong)FREE_BASE; + return (unsigned long)FREE_BASE; } static ucell get_heap_top( void ) @@ -236,7 +236,7 @@ hash_page_64( ucell ea, ucell phys, ucell mode ) static int next_grab_slot=0; uint64_t vsid_mask, page_mask, pgidx, hash; uint64_t htab_mask, mask, avpn; - ulong pgaddr; + unsigned long pgaddr; int i, found; unsigned int vsid, vsid_sh, sdr, sdr_sh, sdr_mask; mPTE_64_t *pp; @@ -300,7 +300,7 @@ static void hash_page_32( ucell ea, ucell phys, ucell mode ) { static int next_grab_slot=0; - ulong *upte, cmp, hash1; + unsigned long *upte, cmp, hash1; int i, vsid, found; mPTE_t *pp; @@ -312,7 +312,7 @@ hash_page_32( ucell ea, ucell phys, ucell mode ) hash1 &= (get_hash_size() - 1) >> 6; pp = (mPTE_t*)(get_hash_base() + (hash1 << 6)); - upte = (ulong*)pp; + upte = (unsigned long*)pp; /* replace old translation */ for( found=0, i=0; !found && i<8; i++ ) @@ -344,7 +344,7 @@ static int is_ppc64(void) return ((pvr >= 0x330000) && (pvr < 0x70330000)); } -static void hash_page( ulong ea, ulong phys, ucell mode ) +static void hash_page( unsigned long ea, unsigned long phys, ucell mode ) { if ( is_ppc64() ) hash_page_64(ea, phys, mode); @@ -355,7 +355,7 @@ static void hash_page( ulong ea, ulong phys, ucell mode ) void dsi_exception( void ) { - ulong dar, dsisr; + unsigned long dar, dsisr; ucell mode; ucell phys; @@ -369,7 +369,7 @@ dsi_exception( void ) void isi_exception( void ) { - ulong nip, srr1; + unsigned long nip, srr1; ucell mode; ucell phys; @@ -386,12 +386,12 @@ isi_exception( void ) /************************************************************************/ void -setup_mmu( ulong ramsize ) +setup_mmu( unsigned long ramsize ) { ofmem_t *ofmem = OFMEM; - ulong sdr1, sr_base, msr; - ulong hash_base; - ulong hash_mask = 0xffff0000; + unsigned long sdr1, sr_base, msr; + unsigned long hash_base; + unsigned long hash_mask = 0xffff0000; int i; memset(ofmem, 0, sizeof(ofmem_t)); diff --git a/arch/ppc/qemu/start.S b/arch/ppc/qemu/start.S index 66df9a2..d6777a8 100644 --- a/arch/ppc/qemu/start.S +++ b/arch/ppc/qemu/start.S @@ -524,7 +524,7 @@ GLOBL(of_rtas_end): #define CACHE_LINE_SIZE 32 #define LG_CACHE_LINE_SIZE 5 -/* flush_icache_range( ulong start, ulong stop) */ +/* flush_icache_range( unsigned long start, unsigned long stop) */ GLOBL(flush_icache_range): li r5,CACHE_LINE_SIZE-1 andc r3,r3,r5 diff --git a/arch/ppc/start.S b/arch/ppc/start.S index eac66a8..40ee089 100644 --- a/arch/ppc/start.S +++ b/arch/ppc/start.S @@ -312,7 +312,7 @@ GLOBL(__vectors_end): #define CACHE_LINE_SIZE 32 #define LG_CACHE_LINE_SIZE 5 -/* flush_icache_range( ulong start, ulong stop) */ +/* flush_icache_range( unsigned long start, unsigned long stop) */ GLOBL(flush_icache_range): li r5,CACHE_LINE_SIZE-1 andc r3,r3,r5 diff --git a/arch/sparc32/linux_load.c b/arch/sparc32/linux_load.c index 69edadc..038cb50 100644 --- a/arch/sparc32/linux_load.c +++ b/arch/sparc32/linux_load.c @@ -161,7 +161,7 @@ static int fd; static unsigned long file_size(void) { - llong fpos, fsize; + long long fpos, fsize; /* Save current position */ fpos = tell(fd); diff --git a/arch/sparc64/linux_load.c b/arch/sparc64/linux_load.c index 9adf7b5..fe61a35 100644 --- a/arch/sparc64/linux_load.c +++ b/arch/sparc64/linux_load.c @@ -161,7 +161,7 @@ static int fd; static unsigned long file_size(void) { - llong fpos, fsize; + long long fpos, fsize; /* Save current position */ fpos = tell(fd); diff --git a/arch/unix/boot.c b/arch/unix/boot.c index 54713a7..170a00a 100644 --- a/arch/unix/boot.c +++ b/arch/unix/boot.c @@ -36,7 +36,7 @@ void return NULL; } - (ullong *)entry = ehdr.e_entry; + (unsigned long long *)entry = ehdr.e_entry; lszz_offs = elf_offs; for( i=0; icurrent) return; diff --git a/fs/ext2/ext2_utils.h b/fs/ext2/ext2_utils.h index 8348e7b..43544d8 100644 --- a/fs/ext2/ext2_utils.h +++ b/fs/ext2/ext2_utils.h @@ -36,7 +36,7 @@ /* utilities */ -extern int ext2_probe(int fd, llong offset); +extern int ext2_probe(int fd, long long offset); extern void ext2_get_super(int fd, struct ext2_super_block *super); extern void ext2_read_block(ext2_VOLUME* volume, unsigned int fsblock); extern void ext2_get_group_desc(ext2_VOLUME* volume, diff --git a/fs/grubfs/defs.h b/fs/grubfs/defs.h index ec316a7..3a3128c 100644 --- a/fs/grubfs/defs.h +++ b/fs/grubfs/defs.h @@ -42,14 +42,6 @@ #define btodb(byte_offset) ((byte_offset) >> 9) #define dbtob(block_number) ((block_number) << 9) -/* - * Compatibility definitions for old type names. - */ - -typedef unsigned char u_char; /* unsigned char */ -typedef unsigned short u_short; /* unsigned short */ -typedef unsigned int u_int; /* unsigned int */ - typedef struct _quad_ { unsigned int val[2]; /* 2 int values make... */ diff --git a/fs/grubfs/dir.h b/fs/grubfs/dir.h index 997847f..a775cab 100644 --- a/fs/grubfs/dir.h +++ b/fs/grubfs/dir.h @@ -76,9 +76,9 @@ struct direct { - u_int d_ino; /* inode number of entry */ - u_short d_reclen; /* length of this record */ - u_short d_namlen; /* length of string in d_name */ + unsigned int d_ino; /* inode number of entry */ + unsigned short d_reclen; /* length of this record */ + unsigned short d_namlen; /* length of string in d_name */ char d_name[MAXNAMLEN + 1]; /* name with length <= MAXNAMLEN */ }; @@ -100,11 +100,11 @@ struct direct */ struct dirtemplate { - u_int dot_ino; + unsigned int dot_ino; short dot_reclen; short dot_namlen; char dot_name[4]; /* must be multiple of 4 */ - u_int dotdot_ino; + unsigned int dotdot_ino; short dotdot_reclen; short dotdot_namlen; char dotdot_name[4]; /* ditto */ diff --git a/fs/grubfs/disk_inode.h b/fs/grubfs/disk_inode.h index 2103cb8..68a61c7 100644 --- a/fs/grubfs/disk_inode.h +++ b/fs/grubfs/disk_inode.h @@ -61,7 +61,7 @@ struct icommon { - u_short ic_mode; /* 0: mode and type of file */ + unsigned short ic_mode; /* 0: mode and type of file */ short ic_nlink; /* 2: number of links to file */ mach_uid_t ic_uid; /* 4: owner's user id */ mach_gid_t ic_gid; /* 6: owner's group id */ diff --git a/fs/grubfs/fs.h b/fs/grubfs/fs.h index 5ad916e..260e926 100644 --- a/fs/grubfs/fs.h +++ b/fs/grubfs/fs.h @@ -231,9 +231,9 @@ struct fs int fs_postblformat; /* format of positional layout tables */ int fs_nrpos; /* number of rotaional positions */ int fs_postbloff; /* (short) rotation block list head */ - int fs_rotbloff; /* (u_char) blocks for each rotation */ + int fs_rotbloff; /* (char) blocks for each rotation */ int fs_magic; /* magic number */ - u_char fs_space[1]; /* list of blocks for each rotation */ + unsigned char fs_space[1]; /* list of blocks for each rotation */ /* actually longer */ }; /* @@ -257,7 +257,7 @@ struct fs #define fs_rotbl(fs) \ (((fs)->fs_postblformat == FS_42POSTBLFMT) \ ? ((fs)->fs_space) \ - : ((u_char *)((char *)(fs) + (fs)->fs_rotbloff))) + : ((unsigned char *)((char *)(fs) + (fs)->fs_rotbloff))) /* * Convert cylinder group to base address of its global summary info. @@ -288,10 +288,10 @@ struct cg int cg_btotoff; /* (long) block totals per cylinder */ int cg_boff; /* (short) free block positions */ int cg_iusedoff; /* (char) used inode map */ - int cg_freeoff; /* (u_char) free block map */ - int cg_nextfreeoff; /* (u_char) next available space */ + int cg_freeoff; /* (char) free block map */ + int cg_nextfreeoff; /* (char) next available space */ int cg_sparecon[16]; /* reserved for future use */ - u_char cg_space[1]; /* space for cylinder group maps */ + unsigned char cg_space[1]; /* space for cylinder group maps */ /* actually longer */ }; /* @@ -312,7 +312,7 @@ struct cg #define cg_blksfree(cgp) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_free) \ - : ((u_char *)((char *)(cgp) + (cgp)->cg_freeoff))) + : ((unsigned char *)((char *)(cgp) + (cgp)->cg_freeoff))) #define cg_chkmagic(cgp) \ ((cgp)->cg_magic == CG_MAGIC || ((struct ocg *)(cgp))->cg_magic == CG_MAGIC) @@ -338,7 +338,7 @@ struct ocg short cg_b[32][8]; /* positions of free blocks */ char cg_iused[256]; /* used inode map */ int cg_magic; /* magic number */ - u_char cg_free[1]; /* free block map */ + unsigned char cg_free[1]; /* free block map */ /* actually longer */ }; diff --git a/fs/grubfs/grubfs_fs.c b/fs/grubfs/grubfs_fs.c index cfc44a5..2a0439c 100644 --- a/fs/grubfs/grubfs_fs.c +++ b/fs/grubfs/grubfs_fs.c @@ -100,7 +100,7 @@ typedef struct { const struct fsys_entry *fsys; grubfile_t *fd; int dev_fd; - llong offset; /* Offset added onto each device read; should only ever be non-zero + long long offset; /* Offset added onto each device read; should only ever be non-zero when probing a partition for a filesystem */ } grubfs_t; @@ -123,7 +123,7 @@ int devread( unsigned long sector, unsigned long byte_offset, unsigned long byte_len, void *buf ) { - llong offs = (llong)sector * 512 + byte_offset; + long long offs = (long long)sector * 512 + byte_offset; #ifdef CONFIG_DEBUG_FS //printk("devread s=%x buf=%x, fd=%x\n",sector, buf, curfs->dev_fd); @@ -260,7 +260,7 @@ grubfs_files_read( grubfs_info_t *mi ) static void grubfs_files_seek( grubfs_info_t *mi ) { - llong pos = DPOP(); + long long pos = DPOP(); int offs = (int)pos; int whence = SEEK_SET; @@ -332,7 +332,7 @@ static void grubfs_files_probe( grubfs_info_t *dummy ) { ihandle_t ih = POP_ih(); - llong offs = DPOP(); + long long offs = DPOP(); int i; curfs->dev_fd = open_ih(ih); diff --git a/fs/grubfs/iso9660.h b/fs/grubfs/iso9660.h index 0557be8..6423a8f 100644 --- a/fs/grubfs/iso9660.h +++ b/fs/grubfs/iso9660.h @@ -57,23 +57,19 @@ #ifndef ASM_FILE -typedef uint8_t u_int8_t; -typedef uint16_t u_int16_t; -typedef uint32_t u_int32_t; - typedef union { - u_int8_t l,b; + uint8_t l,b; } iso_8bit_t; typedef struct __iso_16bit { - u_int16_t l, b; + uint16_t l, b; } iso_16bit_t; typedef struct __iso_32bit { - u_int32_t l, b; + uint32_t l, b; } iso_32bit_t; -typedef u_int8_t iso_date_t[7]; +typedef uint8_t iso_date_t[7]; struct iso_directory_record { iso_8bit_t length; @@ -86,49 +82,49 @@ struct iso_directory_record { iso_8bit_t interleave; iso_16bit_t volume_seq_number; iso_8bit_t name_len; - u_int8_t name[1]; + uint8_t name[1]; } __attribute__ ((packed)); struct iso_primary_descriptor { iso_8bit_t type; - u_int8_t id[5]; + uint8_t id[5]; iso_8bit_t version; - u_int8_t _unused1[1]; - u_int8_t system_id[32]; - u_int8_t volume_id[32]; - u_int8_t _unused2[8]; + uint8_t _unused1[1]; + uint8_t system_id[32]; + uint8_t volume_id[32]; + uint8_t _unused2[8]; iso_32bit_t volume_space_size; - u_int8_t _unused3[32]; + uint8_t _unused3[32]; iso_16bit_t volume_set_size; iso_16bit_t volume_seq_number; iso_16bit_t logical_block_size; iso_32bit_t path_table_size; - u_int8_t type_l_path_table[4]; - u_int8_t opt_type_l_path_table[4]; - u_int8_t type_m_path_table[4]; - u_int8_t opt_type_m_path_table[4]; + uint8_t type_l_path_table[4]; + uint8_t opt_type_l_path_table[4]; + uint8_t type_m_path_table[4]; + uint8_t opt_type_m_path_table[4]; struct iso_directory_record root_directory_record; - u_int8_t volume_set_id[128]; - u_int8_t publisher_id[128]; - u_int8_t preparer_id[128]; - u_int8_t application_id[128]; - u_int8_t copyright_file_id[37]; - u_int8_t abstract_file_id[37]; - u_int8_t bibliographic_file_id[37]; - u_int8_t creation_date[17]; - u_int8_t modification_date[17]; - u_int8_t expiration_date[17]; - u_int8_t effective_date[17]; + uint8_t volume_set_id[128]; + uint8_t publisher_id[128]; + uint8_t preparer_id[128]; + uint8_t application_id[128]; + uint8_t copyright_file_id[37]; + uint8_t abstract_file_id[37]; + uint8_t bibliographic_file_id[37]; + uint8_t creation_date[17]; + uint8_t modification_date[17]; + uint8_t expiration_date[17]; + uint8_t effective_date[17]; iso_8bit_t file_structure_version; - u_int8_t _unused4[1]; - u_int8_t application_data[512]; - u_int8_t _unused5[653]; + uint8_t _unused4[1]; + uint8_t application_data[512]; + uint8_t _unused5[653]; } __attribute__ ((packed)); struct rock_ridge { - u_int16_t signature; - u_int8_t len; - u_int8_t version; + uint16_t signature; + uint8_t len; + uint8_t version; union { struct CE { iso_32bit_t extent; @@ -137,7 +133,7 @@ struct rock_ridge { } ce; struct NM { iso_8bit_t flags; - u_int8_t name[0]; + uint8_t name[0]; } nm; struct PX { iso_32bit_t mode; diff --git a/fs/hfs/hfs.c b/fs/hfs/hfs.c index 931cd8a..0c5fefb 100644 --- a/fs/hfs/hfs.c +++ b/fs/hfs/hfs.c @@ -741,7 +741,7 @@ int hfs_fstat(hfsfile *file, hfsdirent *ent) * NAME: hfs->probe() * DESCRIPTION: return whether a HFS filesystem is present at the given offset */ -int hfs_probe(int fd, llong offset) +int hfs_probe(int fd, long long offset) { return v_probe(fd, offset); } diff --git a/fs/hfs/hfs_fs.c b/fs/hfs/hfs_fs.c index a0ce21e..a0771c0 100644 --- a/fs/hfs/hfs_fs.c +++ b/fs/hfs/hfs_fs.c @@ -55,7 +55,7 @@ DECLARE_NODE( hfs, 0, sizeof(hfs_info_t), "+/packages/hfs-files" ); /************************************************************************/ static int -_find_file( hfsvol *vol, const char *path, ulong type, ulong creator ) +_find_file( hfsvol *vol, const char *path, unsigned long type, unsigned long creator ) { hfsdirent ent; hfsdir *dir; @@ -67,7 +67,7 @@ _find_file( hfsvol *vol, const char *path, ulong type, ulong creator ) while( ret && !hfs_readdir(dir, &ent) ) { if( ent.flags & HFS_ISDIR ) continue; - ret = !(*(ulong*)ent.u.file.type == type && *(ulong*)ent.u.file.creator == creator ); + ret = !(*(unsigned long*)ent.u.file.type == type && *(unsigned long*)ent.u.file.creator == creator ); } hfs_closedir( dir ); @@ -96,7 +96,7 @@ _search( hfsvol *vol, const char *path, const char *sname, hfsfile **ret_fd ) /* printk("DIRECTORY: %s\n", path ); */ while( status && !hfs_readdir(dir, &ent) ) { - ulong type, creator; + unsigned long type, creator; *p = 0; topdir = 0; @@ -112,8 +112,8 @@ _search( hfsvol *vol, const char *path, const char *sname, hfsfile **ret_fd ) continue; } - type = *(ulong*)ent.u.file.type; - creator = *(ulong*)ent.u.file.creator; + type = *(unsigned long*)ent.u.file.type; + creator = *(unsigned long*)ent.u.file.creator; /* look for Mac OS ROM, System and Finder in the same directory */ if( type == MAC_OS_ROM_TYPE && creator == MAC_OS_ROM_CREATOR ) { @@ -372,7 +372,7 @@ hfs_files_read( hfs_info_t *mi ) static void hfs_files_seek( hfs_info_t *mi ) { - llong pos = DPOP(); + long long pos = DPOP(); int offs = (int)pos; int whence = SEEK_SET; int ret; @@ -437,7 +437,7 @@ hfs_files_get_path( hfs_info_t *mi ) hfsvol *vol = hfs_getvol( NULL ); hfsdirent ent; int start, ns; - ulong id; + unsigned long id; if (common->type != FILE) RET( 0 ); @@ -542,7 +542,7 @@ static void hfs_files_probe( hfs_info_t *dummy ) { ihandle_t ih = POP_ih(); - llong offs = DPOP(); + long long offs = DPOP(); int fd, ret = 0; fd = open_ih(ih); diff --git a/fs/hfs/include/hfs.h b/fs/hfs/include/hfs.h index d07750e..9996cc8 100644 --- a/fs/hfs/include/hfs.h +++ b/fs/hfs/include/hfs.h @@ -177,4 +177,4 @@ int hfs_nparts(const char *); int hfs_format(const char *, int, int, const char *, unsigned int, const unsigned long []); -int hfs_probe(int fd, llong offset); +int hfs_probe(int fd, long long offset); diff --git a/fs/hfs/include/volume.h b/fs/hfs/include/volume.h index a314fc2..562c2d1 100644 --- a/fs/hfs/include/volume.h +++ b/fs/hfs/include/volume.h @@ -66,6 +66,6 @@ int v_mkdir(hfsvol *, unsigned long, const char *); int v_scavenge(hfsvol *); -int v_probe(int fd, llong offset); +int v_probe(int fd, long long offset); #endif /* _H_VOLUME */ diff --git a/fs/hfs/volume.c b/fs/hfs/volume.c index 9effe49..4faf7e6 100644 --- a/fs/hfs/volume.c +++ b/fs/hfs/volume.c @@ -594,7 +594,7 @@ fail: /* Determine whether the volume is a HFS volume */ int -v_probe(int fd, llong offset) +v_probe(int fd, long long offset) { MDB *mdb; diff --git a/fs/hfs_mdb.h b/fs/hfs_mdb.h index 19182a0..652525d 100644 --- a/fs/hfs_mdb.h +++ b/fs/hfs_mdb.h @@ -89,27 +89,27 @@ typedef struct hfs_mdb { typedef struct hfs_plus_mdb { - ushort signature; - ushort version; - uint attributes; - uint lastMountedVersion; - uint reserved; + unsigned short signature; + unsigned short version; + unsigned int attributes; + unsigned int lastMountedVersion; + unsigned int reserved; - uint createDate; - uint modifyDate; - uint backupDate; - uint checkedDate; + unsigned int createDate; + unsigned int modifyDate; + unsigned int backupDate; + unsigned int checkedDate; - uint fileCount; - uint folderCount; + unsigned int fileCount; + unsigned int folderCount; - uint blockSize; - uint totalBlocks; - uint freeBlocks; + unsigned int blockSize; + unsigned int totalBlocks; + unsigned int freeBlocks; - uint nextAllocation; - uint rsrcClumpSize; - uint dataClumpSize; + unsigned int nextAllocation; + unsigned int rsrcClumpSize; + unsigned int dataClumpSize; /* ... there are more fields here ... */ } hfs_plus_mdb_t; diff --git a/fs/hfsplus/hfsp_fs.c b/fs/hfsplus/hfsp_fs.c index 27ca77c..2e8bfaf 100644 --- a/fs/hfsplus/hfsp_fs.c +++ b/fs/hfsplus/hfsp_fs.c @@ -314,7 +314,7 @@ hfsp_files_read( hfsp_info_t *mi ) static void hfsp_files_seek( hfsp_info_t *mi ) { - llong pos = DPOP(); + long long pos = DPOP(); int offs = (int)pos; int whence = SEEK_SET; @@ -448,7 +448,7 @@ static void hfsp_files_probe( hfsp_info_t *dummy ) { ihandle_t ih = POP_ih(); - llong offs = DPOP(); + long long offs = DPOP(); int fd, ret = 0; fd = open_ih(ih); diff --git a/fs/hfsplus/include/volume.h b/fs/hfsplus/include/volume.h index b767fcd..19be055 100644 --- a/fs/hfsplus/include/volume.h +++ b/fs/hfsplus/include/volume.h @@ -73,7 +73,7 @@ static inline btree* volume_get_extents_tree(volume* vol) { } /* Determine whether the volume is a HFS-plus volume */ -int volume_probe(int fd, llong offset); +int volume_probe(int fd, long long offset); #ifdef DEBUG /* Print raw fork information to stdout */ diff --git a/fs/hfsplus/volume.c b/fs/hfsplus/volume.c index df6bc0c..40b3eac 100644 --- a/fs/hfsplus/volume.c +++ b/fs/hfsplus/volume.c @@ -292,7 +292,7 @@ volume_create_extents_tree(volume* vol) /* Determine whether the volume is a HFS-plus volume */ int -volume_probe(int fd, llong offset) +volume_probe(int fd, long long offset) { UInt16 *vol; int ret = 0; diff --git a/fs/ioglue.c b/fs/ioglue.c index 95b5612..1d33d8f 100644 --- a/fs/ioglue.c +++ b/fs/ioglue.c @@ -47,8 +47,8 @@ get_hfs_vol_name( int fd, char *buf, int size ) return buf; } -ulong -os_read( int fd, void *buf, ulong len, int blksize_bits ) +unsigned long +os_read( int fd, void *buf, unsigned long len, int blksize_bits ) { /* printk("os_read %d\n", (int)len); */ @@ -56,11 +56,11 @@ os_read( int fd, void *buf, ulong len, int blksize_bits ) return (cnt > 0)? (cnt >> blksize_bits) : cnt; } -ulong -os_seek( int fd, ulong blknum, int blksize_bits ) +unsigned long +os_seek( int fd, unsigned long blknum, int blksize_bits ) { /* printk("os_seek %d\n", blknum ); */ - llong offs = (llong)blknum << blksize_bits; + long long offs = (long long)blknum << blksize_bits; /* offset == -1 means seek to EOF */ if( (int)blknum == -1 ) @@ -68,7 +68,7 @@ os_seek( int fd, ulong blknum, int blksize_bits ) if( seek_io(fd, offs) ) { /* printk("os_seek failure\n"); */ - return (ulong)-1; + return (unsigned long)-1; } if( (int)blknum == -1 ) { @@ -80,7 +80,7 @@ os_seek( int fd, ulong blknum, int blksize_bits ) } void -os_seek_offset( int fd, llong offset ) +os_seek_offset( int fd, long long offset ) { seek_io(fd, offset); } diff --git a/fs/iso9660/iso9660_fs.c b/fs/iso9660/iso9660_fs.c index 73c54de..e77cc1e 100644 --- a/fs/iso9660/iso9660_fs.c +++ b/fs/iso9660/iso9660_fs.c @@ -105,7 +105,7 @@ iso9660_files_read( iso9660_info_t *mi ) static void iso9660_files_seek( iso9660_info_t *mi ) { - llong pos = DPOP(); + long long pos = DPOP(); cell ret; int offs = (int)pos; int whence = SEEK_SET; @@ -215,7 +215,7 @@ static void iso9660_files_probe( iso9660_info_t *dummy ) { ihandle_t ih = POP_ih(); - llong offs = DPOP(); + long long offs = DPOP(); int fd, ret = 0; fd = open_ih(ih); diff --git a/fs/iso9660/iso9660_mount.c b/fs/iso9660/iso9660_mount.c index 16833a8..6556014 100644 --- a/fs/iso9660/iso9660_mount.c +++ b/fs/iso9660/iso9660_mount.c @@ -189,7 +189,7 @@ int iso9660_umount(iso9660_VOLUME* volume) return 0; } -int iso9660_probe(int fd, llong offset) +int iso9660_probe(int fd, long long offset) { struct iso_primary_descriptor ipd; diff --git a/fs/iso9660/libiso9660.h b/fs/iso9660/libiso9660.h index 20c4184..8a5b480 100644 --- a/fs/iso9660/libiso9660.h +++ b/fs/iso9660/libiso9660.h @@ -14,7 +14,7 @@ extern iso9660_VOLUME* iso9660_mount(int fd); extern int iso9660_umount(iso9660_VOLUME *volume); -extern int iso9660_probe(int fd, llong offs); +extern int iso9660_probe(int fd, long long offs); extern iso9660_DIR* iso9660_opendir(iso9660_VOLUME *, const char *name); extern iso9660_FILE* iso9660_open(iso9660_VOLUME *, const char *pathname); extern int iso9660_closedir(iso9660_DIR *dir); diff --git a/fs/os.h b/fs/os.h index 0aaf3a9..b0375f7 100644 --- a/fs/os.h +++ b/fs/os.h @@ -51,7 +51,7 @@ unsigned long os_write( int fd, const void *buf, unsigned long len, int blksize_ * NAME: os->seek_offset() * DESCRIPTION: set a descriptor's seek pointer (offset in bytes) */ -void os_seek_offset( int fd, llong offset ); +void os_seek_offset( int fd, long long offset ); #endif /* _H_OS */ diff --git a/include/arch/ppc/processor.h b/include/arch/ppc/processor.h index 87e3693..3afb03f 100644 --- a/include/arch/ppc/processor.h +++ b/include/arch/ppc/processor.h @@ -389,15 +389,15 @@ /* opcode macros */ -#define OPCODE_PRIM(n) ( ((ulong)(n)) >> 26 ) -#define OPCODE_EXT(n) ( (((ulong)(n)) >> 1) & 0x3ff ) +#define OPCODE_PRIM(n) ( ((unsigned long)(n)) >> 26 ) +#define OPCODE_EXT(n) ( (((unsigned long)(n)) >> 1) & 0x3ff ) #define OPCODE(op,op_ext) ( ((op)<<10) + op_ext ) -#define B1(n) ( (((ulong)(n)) >> 21) & 0x1f ) -#define B2(n) ( (((ulong)(n)) >> 16) & 0x1f ) -#define B3(n) ( (((ulong)(n)) >> 11) & 0x1f ) +#define B1(n) ( (((unsigned long)(n)) >> 21) & 0x1f ) +#define B2(n) ( (((unsigned long)(n)) >> 16) & 0x1f ) +#define B3(n) ( (((unsigned long)(n)) >> 11) & 0x1f ) -#define BD(n) ((ulong)((n) & 0x7fff) + (((n) & 0x8000) ? (ulong)0xffff8000 : 0)) +#define BD(n) ((unsigned long)((n) & 0x7fff) + (((n) & 0x8000) ? (unsigned long)0xffff8000 : 0)) #define SPRNUM_FLIP( v ) ( (((v)>>5) & 0x1f) | (((v)<<5) & 0x3e0) ) diff --git a/include/config.h b/include/config.h index 3bc0fe3..d5a1e20 100644 --- a/include/config.h +++ b/include/config.h @@ -23,14 +23,6 @@ #define PROGRAM_NAME "OpenBIOS" -typedef unsigned long ulong; -typedef unsigned int uint; -typedef unsigned short ushort; -typedef unsigned char uchar; - -typedef unsigned long long ullong; -typedef long long llong; - #ifndef BOOTSTRAP #ifndef NULL @@ -44,7 +36,7 @@ typedef signed int off_t; typedef unsigned int time_t; -#define UINT_MAX ((uint)-1) +#define UINT_MAX ((unsigned int)-1) #define ENOMEM 1 #define EIO 2 diff --git a/include/fs/fs.h b/include/fs/fs.h index 672a780..0a22fa2 100644 --- a/include/fs/fs.h +++ b/include/fs/fs.h @@ -53,42 +53,42 @@ const char *fs_get_name( fs_ops_t *fs ); #ifdef CONFIG_HFSP extern int fs_hfsp_open( int fd, fs_ops_t *fs ); -extern int fs_hfsp_probe( int fd, llong offs ); +extern int fs_hfsp_probe( int fd, long long offs ); #else static inline int fs_hfsp_open( int fd, fs_ops_t *fs ) { return -1; } -static inline int fs_hfsp_probe( int fd, llong offs ) { return -1; } +static inline int fs_hfsp_probe( int fd, long long offs ) { return -1; } #endif #ifdef CONFIG_HFS extern int fs_hfs_open( int fd, fs_ops_t *fs ); -extern int fs_hfs_probe( int fd, llong offs ); +extern int fs_hfs_probe( int fd, long long offs ); #else static inline int fs_hfs_open( int fd, fs_ops_t *fs ) { return -1; } -static inline int fs_hfs_probe( int fd, llong offs ) { return -1; } +static inline int fs_hfs_probe( int fd, long long offs ) { return -1; } #endif #ifdef CONFIG_ISO9660 extern int fs_iso9660_open( int fd, fs_ops_t *fs ); -extern int fs_iso9660_probe( int fd, llong offs ); +extern int fs_iso9660_probe( int fd, long long offs ); #else static inline int fs_iso9660_open( int fd, fs_ops_t *fs ) { return -1; } -static inline int fs_iso9660_probe( int fd, llong offs ) { return -1; } +static inline int fs_iso9660_probe( int fd, long long offs ) { return -1; } #endif #ifdef CONFIG_EXT2 extern int fs_ext2_open( int fd, fs_ops_t *fs ); -extern int fs_ext2_probe( int fd, llong offs ); +extern int fs_ext2_probe( int fd, long long offs ); #else static inline int fs_ext2_open( int fd, fs_ops_t *fs ) { return -1; } -static inline int fs_ext2_probe( int fd, llong offs ) { return -1; } +static inline int fs_ext2_probe( int fd, long long offs ) { return -1; } #endif #ifdef CONFIG_GRUBFS extern int fs_grubfs_open( int fd, fs_ops_t *fs ); -extern int fs_grubfs_probe( int fd, llong offs ); +extern int fs_grubfs_probe( int fd, long long offs ); #else static inline int fs_grubfs_open( int fd, fs_ops_t *fs ) { return -1; } -static inline int fs_grubfs_probe( int fd, llong offs ) { return -1; } +static inline int fs_grubfs_probe( int fd, long long offs ) { return -1; } #endif diff --git a/include/libc/diskio.h b/include/libc/diskio.h index 9244959..3a5abb6 100644 --- a/include/libc/diskio.h +++ b/include/libc/diskio.h @@ -21,8 +21,8 @@ extern int open_ih( ihandle_t ih ); extern int open_io( const char *spec ); extern int close_io( int fd ); extern int read_io( int fd, void *buf, size_t cnt ); -extern int seek_io( int fd, llong offs ); -extern llong tell( int fd ); +extern int seek_io( int fd, long long offs ); +extern long long tell( int fd ); extern int reopen( int fd, const char *filename ); extern int reopen_nwrom( int fd ); extern ihandle_t get_ih_from_fd( int fd ); diff --git a/include/libopenbios/ofmem.h b/include/libopenbios/ofmem.h index b79909c..0bd63a3 100644 --- a/include/libopenbios/ofmem.h +++ b/include/libopenbios/ofmem.h @@ -108,8 +108,8 @@ extern ucell ofmem_translate( ucell virt, ucell *ret_mode ); #ifdef CONFIG_PPC #define PAGE_SHIFT 12 -ulong get_ram_top( void ); -ulong get_ram_bottom( void ); +unsigned long get_ram_top( void ); +unsigned long get_ram_bottom( void ); #elif defined(CONFIG_SPARC32) #define PAGE_SHIFT 12 diff --git a/libc/diskio.c b/libc/diskio.c index a8aac6d..b44e391 100644 --- a/libc/diskio.c +++ b/libc/diskio.c @@ -185,7 +185,7 @@ read_io( int fd, void *buf, size_t cnt ) } int -seek_io( int fd, llong offs ) +seek_io( int fd, long long offs ) { priv_fd_t *fdp; @@ -200,11 +200,11 @@ seek_io( int fd, llong offs ) } } -llong +long long tell( int fd ) { priv_fd_t *fdp = file_descriptors[fd]; - llong offs; + long long offs; if( lookup_xt(fdp->ih, "tell", &fdp->tell_xt) ) return -1; diff --git a/libopenbios/client.c b/libopenbios/client.c index 3e06b92..9cea0e7 100644 --- a/libopenbios/client.c +++ b/libopenbios/client.c @@ -35,7 +35,7 @@ typedef struct prom_args { const char *service; long nargs; long nret; - ulong args[PROM_MAX_ARGS]; + unsigned long args[PROM_MAX_ARGS]; } prom_args_t; #ifdef DEBUG_CIF diff --git a/libopenbios/console_common.c b/libopenbios/console_common.c index 9097e31..20dc3b3 100644 --- a/libopenbios/console_common.c +++ b/libopenbios/console_common.c @@ -56,13 +56,13 @@ static struct { static int get_conschar( int x, int y ) { - if( (uint)x < cons.w && (uint)y < cons.h ) + if( (unsigned int)x < cons.w && (unsigned int)y < cons.h ) return cons.buf[y*cons.w + x]; return ' '; } static void -draw_char( uint h, uint v ) +draw_char( unsigned int h, unsigned int v ) { const unsigned char *c = fontdata; int x, y, xx, rskip, m; @@ -152,7 +152,7 @@ console_close( void ) static void rec_char( int ch, int x, int y ) { - if( (uint)x < cons.w && (uint)y < cons.h ) { + if( (unsigned int)x < cons.w && (unsigned int)y < cons.h ) { cons.buf[y*cons.w + x] = ch; draw_char( x, y ); } @@ -318,8 +318,8 @@ do_con_trol(unsigned char ch) cons.y = cons.vc_par[0]; return; case 'J': - if (cons.vc_par[0] == 0 && (uint)cons.y < (uint)cons.h && - (uint)cons.x < (uint)cons.w) { + if (cons.vc_par[0] == 0 && (unsigned int)cons.y < (unsigned int)cons.h && + (unsigned int)cons.x < (unsigned int)cons.w) { // erase from cursor to end of display for (i = cons.x; i < cons.w; i++) cons.buf[cons.y * cons.w + i] = ' '; diff --git a/libopenbios/elf_load.c b/libopenbios/elf_load.c index 51cc363..77a9753 100644 --- a/libopenbios/elf_load.c +++ b/libopenbios/elf_load.c @@ -497,8 +497,8 @@ elf_init_program(void) #if DEBUG debug("filesz: %08lX memsz: %08lX p_offset: %08lX " "p_vaddr %08lX\n", - (ulong)phdr[i].p_filesz, (ulong)phdr[i].p_memsz, - (ulong)phdr[i].p_offset, (ulong)phdr[i].p_vaddr ); + (unsigned long)phdr[i].p_filesz, (unsigned long)phdr[i].p_memsz, + (unsigned long)phdr[i].p_offset, (unsigned long)phdr[i].p_vaddr ); #endif size = MIN(phdr[i].p_filesz, phdr[i].p_memsz); diff --git a/packages/cmdline.c b/packages/cmdline.c index 9dc4377..ea6bca3 100644 --- a/packages/cmdline.c +++ b/packages/cmdline.c @@ -382,7 +382,7 @@ go_up: pos = n = strlen( buf ); break; } - if( (uint)ch < 32 ) + if( (unsigned int)ch < 32 ) drop = 1; if( !drop && n < ci->ncol ) { diff --git a/packages/mac-parts.c b/packages/mac-parts.c index 7e92971..a4dbb6e 100644 --- a/packages/mac-parts.c +++ b/packages/mac-parts.c @@ -35,7 +35,7 @@ typedef struct { xt_t seek_xt, read_xt; ucell offs_hi, offs_lo; ucell size_hi, size_lo; - uint blocksize; + unsigned int blocksize; phandle_t filesystem_ph; } macparts_info_t; @@ -144,10 +144,10 @@ macparts_open( macparts_info_t *di ) if (str == NULL || parnum == 0) { /* According to the spec, partition 0 as well as no arguments means the whole disk */ - offs = (llong)0; - size = (llong)__be32_to_cpu(dmap.sbBlkCount) * bs; + offs = (long long)0; + size = (long long)__be32_to_cpu(dmap.sbBlkCount) * bs; - di->blocksize = (uint)bs; + di->blocksize = (unsigned int)bs; di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; @@ -177,8 +177,8 @@ macparts_open( macparts_info_t *di ) if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) && (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) && (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) { - offs = (llong)__be32_to_cpu(par.pmPyPartStart) * bs; - size = (llong)__be32_to_cpu(par.pmPartBlkCnt) * bs; + offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs; + size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs; goto found; } @@ -194,8 +194,8 @@ macparts_open( macparts_info_t *di ) (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) && (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) { - offs = (llong)__be32_to_cpu(par.pmPyPartStart) * bs; - size = (llong)__be32_to_cpu(par.pmPartBlkCnt) * bs; + offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs; + size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs; } } @@ -209,12 +209,12 @@ found: /* If the filename was set to %BOOT, we actually want the bootcode instead */ if (want_bootcode) { - offs += (llong)__be32_to_cpu(par.pmLgBootStart) * bs; - size = (llong)__be32_to_cpu(par.pmBootSize); + offs += (long long)__be32_to_cpu(par.pmLgBootStart) * bs; + size = (long long)__be32_to_cpu(par.pmBootSize); } ret = -1; - di->blocksize = (uint)bs; + di->blocksize = (unsigned int)bs; di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; @@ -293,8 +293,8 @@ macparts_initialize( macparts_info_t *di ) static void macparts_seek(macparts_info_t *di ) { - llong pos = DPOP(); - llong offs, size; + long long pos = DPOP(); + long long offs, size; DPRINTF("macparts_seek %llx:\n", pos); diff --git a/packages/nvram.c b/packages/nvram.c index 9dea52f..4052655 100644 --- a/packages/nvram.c +++ b/packages/nvram.c @@ -35,10 +35,10 @@ do { printk("NVRAM: " fmt , ##args); } while (0) typedef struct { - uchar signature; - uchar checksum; - uchar len_hi; - uchar len_lo; + unsigned char signature; + unsigned char checksum; + unsigned char len_hi; + unsigned char len_lo; char name[12]; char data[0]; } nvpart_t; @@ -225,8 +225,8 @@ nvconf_init( void ) /************************************************************************/ typedef struct { - uint mark_hi; - uint mark_lo; + unsigned int mark_hi; + unsigned int mark_lo; } nvram_ibuf_t; DECLARE_UNNAMED_NODE( nvram, INSTALL_OPEN, sizeof(nvram_ibuf_t )); diff --git a/packages/pc-parts.c b/packages/pc-parts.c index b3832b4..2ec6707 100644 --- a/packages/pc-parts.c +++ b/packages/pc-parts.c @@ -168,11 +168,11 @@ pcparts_open( pcparts_info_t *di ) RET( 0 ); } - offs = (llong)(__le32_to_cpu(p->start_sect)) * bs; + offs = (long long)(__le32_to_cpu(p->start_sect)) * bs; di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; - size = (llong)(__le32_to_cpu(p->nr_sects)) * bs; + size = (long long)(__le32_to_cpu(p->nr_sects)) * bs; di->size_hi = size >> BITS; di->size_lo = size & (ucell) -1; @@ -226,11 +226,11 @@ pcparts_open( pcparts_info_t *di ) RET( 0 ); } - offs = (llong)(cur_table+__le32_to_cpu(p->start_sect)) * bs; + offs = (long long)(cur_table+__le32_to_cpu(p->start_sect)) * bs; di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; - size = (llong)__le32_to_cpu(p->nr_sects) * bs; + size = (long long)__le32_to_cpu(p->nr_sects) * bs; di->size_hi = size >> BITS; di->size_lo = size & (ucell) -1; @@ -332,8 +332,8 @@ pcparts_initialize( pcparts_info_t *di ) static void pcparts_seek(pcparts_info_t *di ) { - llong pos = DPOP(); - llong offs, size; + long long pos = DPOP(); + long long offs, size; DPRINTF("pcparts_seek %llx:\n", pos); diff --git a/packages/sun-parts.c b/packages/sun-parts.c index 1dc5f5b..db52171 100644 --- a/packages/sun-parts.c +++ b/packages/sun-parts.c @@ -185,18 +185,18 @@ sunparts_open( sunparts_info_t *di ) DPRINTF("Selected partition %d\n", parnum); - offs = (llong)__be32_to_cpu(p->partitions[parnum].start_cylinder) * + offs = (long long)__be32_to_cpu(p->partitions[parnum].start_cylinder) * __be16_to_cpu(p->ntrks) * __be16_to_cpu(p->nsect) * bs; di->offs_hi = offs >> BITS; di->offs_lo = offs & (ucell) -1; - size = (llong)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs; + size = (long long)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs; di->size_hi = size >> BITS; di->size_lo = size & (ucell) -1; di->type = __be32_to_cpu(p->infos[parnum].id); DPRINTF("Found Sun partition, offs %lld size %lld\n", - (llong)offs, (llong)size); + (long long)offs, (long long)size); /* Probe for filesystem at current offset */ DPRINTF("sun-parts: about to probe for fs\n"); @@ -264,8 +264,8 @@ sunparts_initialize( __attribute__((unused))sunparts_info_t *di ) static void sunparts_seek(sunparts_info_t *di ) { - llong pos = DPOP(); - llong offs, size;; + long long pos = DPOP(); + long long offs, size;; DPRINTF("sunparts_seek %llx:\n", pos); diff --git a/packages/video.c b/packages/video.c index 7c8ceca..7aef786 100644 --- a/packages/video.c +++ b/packages/video.c @@ -31,7 +31,7 @@ typedef struct osi_fb_info { static struct { int has_video; osi_fb_info_t fb; - ulong *pal; /* 256 elements */ + unsigned long *pal; /* 256 elements */ } video; @@ -83,11 +83,11 @@ startup_splash( void ) for( y=0 ; y= 24 ) { - ulong *d = (ulong*)pp; + unsigned long *d = (unsigned long*)pp; for( x=0; x>9) & 0x7c00) | ((col>>6) & 0x03e0) | ((col>>3) & 0x1f); @@ -102,10 +102,10 @@ startup_splash( void ) #endif } -static ulong +static unsigned long get_color( int col_ind ) { - ulong col; + unsigned long col; if( !video.has_video || col_ind < 0 || col_ind > 255 ) return 0; if( video.fb.depth == 8 ) @@ -129,7 +129,7 @@ draw_pixel( int x, int y, int colind ) color = get_color( colind ); if( d >= 24 ) - *((ulong*)p + x) = color; + *((unsigned long*)p + x) = color; else if( d >= 15 ) *((short*)p + x) = color; else @@ -140,7 +140,7 @@ static void fill_rect( int col_ind, int x, int y, int w, int h ) { char *pp; - ulong col = get_color(col_ind); + unsigned long col = get_color(col_ind); if( !video.has_video || x < 0 || y < 0 || x+w > video.fb.w || y+h > video.fb.h ) return; @@ -149,15 +149,15 @@ fill_rect( int col_ind, int x, int y, int w, int h ) for( ; h--; pp += video.fb.rb ) { int ww = w; if( video.fb.depth == 24 || video.fb.depth == 32 ) { - ulong *p = (ulong*)pp + x; + unsigned long *p = (unsigned long*)pp + x; while( ww-- ) *p++ = col; } else if( video.fb.depth == 16 || video.fb.depth == 15 ) { - ushort *p = (ushort*)pp + x; + unsigned short *p = (unsigned short*)pp + x; while( ww-- ) *p++ = col; } else { - char *p = (char *)((ushort*)pp + x); + char *p = (char *)((unsigned short*)pp + x); while( ww-- ) *p++ = col; @@ -175,7 +175,7 @@ refresh_palette( void ) } void -set_color( int ind, ulong color ) +set_color( int ind, unsigned long color ) { if( !video.has_video || ind < 0 || ind > 255 ) return; @@ -240,11 +240,11 @@ video_set_colors( void ) { int count = POP(); int start = POP(); - uchar *p = (uchar*)POP(); + unsigned char *p = (unsigned char*)POP(); int i; for( i=0; i