1 --- grub-0.96/netboot/main.c
2 +++ grub-0.96/netboot/main.c
5 static int vendorext_isvalid;
6 static unsigned long netmask;
7 -static struct bootpd_t bootp_data;
8 +struct bootpd_t bootp_data;
9 static unsigned long xid;
10 -static unsigned char *end_of_rfc1533 = NULL;
11 +unsigned char *end_of_rfc1533 = NULL;
13 #ifndef NO_DHCP_SUPPORT
14 #endif /* NO_DHCP_SUPPORT */
15 --- grub-0.96/stage2/disk_io.c
16 +++ grub-0.96/stage2/disk_io.c
20 static inline unsigned long
21 -log2 (unsigned long word)
22 +grub_log2 (unsigned long word)
24 asm volatile ("bsfl %1,%0"
27 rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
29 int slen, sectors_per_vtrack;
30 - int sector_size_bits = log2 (buf_geom.sector_size);
31 + int sector_size_bits = grub_log2 (buf_geom.sector_size);
39 - sector_size_bits = log2 (buf_geom.sector_size);
40 + sector_size_bits = grub_log2 (buf_geom.sector_size);
43 /* Make sure that SECTOR is valid. */
44 --- grub-0.96/stage2/fsys_ext2fs.c
45 +++ grub-0.96/stage2/fsys_ext2fs.c
50 -#define log2(n) ffz(~(n))
51 +#define grub_log2(n) ffz(~(n))
53 #define EXT2_SUPER_MAGIC 0xEF53 /* include/linux/ext2_fs.h */
54 #define EXT2_ROOT_INO 2 /* include/linux/ext2_fs.h */
58 #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
59 -#define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s)))
60 +#define EXT2_ADDR_PER_BLOCK_BITS(s) (grub_log2(EXT2_ADDR_PER_BLOCK(s)))
63 #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
66 /* look up an inode */
67 group_id = (current_ino - 1) / (SUPERBLOCK->s_inodes_per_group);
68 - group_desc = group_id >> log2 (EXT2_DESC_PER_BLOCK (SUPERBLOCK));
69 + group_desc = group_id >> grub_log2 (EXT2_DESC_PER_BLOCK (SUPERBLOCK));
70 desc = group_id & (EXT2_DESC_PER_BLOCK (SUPERBLOCK) - 1);
72 printf ("ipg=%d, dpb=%d\n", SUPERBLOCK->s_inodes_per_group,
75 ino_blk = gdp[desc].bg_inode_table +
76 (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
77 - >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
78 + >> grub_log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
80 printf ("inode table fsblock=%d\n", ino_blk);
82 --- grub-0.96/stage2/fsys_fat.c
83 +++ grub-0.96/stage2/fsys_fat.c
85 #define FAT_CACHE_SIZE 2048
87 static __inline__ unsigned long
88 -log2 (unsigned long word)
89 +grub_log2 (unsigned long word)
94 if (bpb.sects_per_clust == 0)
97 - FAT_SUPER->sectsize_bits = log2 (FAT_CVT_U16 (bpb.bytes_per_sect));
98 + FAT_SUPER->sectsize_bits = grub_log2 (FAT_CVT_U16 (bpb.bytes_per_sect));
99 FAT_SUPER->clustsize_bits
100 - = FAT_SUPER->sectsize_bits + log2 (bpb.sects_per_clust);
101 + = FAT_SUPER->sectsize_bits + grub_log2 (bpb.sects_per_clust);
103 /* Fill in info about super block */
104 FAT_SUPER->num_sectors = FAT_CVT_U16 (bpb.short_sectors)
105 --- grub-0.96/stage2/fsys_iso9660.c
106 +++ grub-0.96/stage2/fsys_iso9660.c
110 static inline unsigned long
111 -log2 (unsigned long word)
112 +grub_log2 (unsigned long word)
114 asm volatile ("bsfl %1,%0"
118 iso9660_devread (int sector, int byte_offset, int byte_len, char *buf)
120 - unsigned short sector_size_lg2 = log2(buf_geom.sector_size);
121 + unsigned short sector_size_lg2 = grub_log2(buf_geom.sector_size);
124 * We have to use own devread() function since BIOS return wrong geometry
125 --- grub-0.96/stage2/fsys_reiserfs.c
126 +++ grub-0.96/stage2/fsys_reiserfs.c
130 static __inline__ unsigned long
131 -log2 (unsigned long word)
132 +grub_log2 (unsigned long word)
134 __asm__ ("bsfl %1,%0"
138 INFO->version = super.s_version;
139 INFO->blocksize = super.s_blocksize;
140 - INFO->fullblocksize_shift = log2 (super.s_blocksize);
141 + INFO->fullblocksize_shift = grub_log2 (super.s_blocksize);
142 INFO->blocksize_shift = INFO->fullblocksize_shift - SECTOR_BITS;
144 (FSYSREISER_CACHE_SIZE >> INFO->fullblocksize_shift) - 1;
145 --- grub-0.96/stage2/iso9660.h
146 +++ grub-0.96/stage2/iso9660.h
149 typedef struct __iso_16bit {
151 -} iso_16bit_t __attribute__ ((packed));
154 typedef struct __iso_32bit {
156 -} iso_32bit_t __attribute__ ((packed));
159 typedef u_int8_t iso_date_t[7];