2004-03-14 Jeroen Dekkers <jeroen@dekkers.cx>
* Makefile.in: Update copyright. * genmodsrc.sh: Likewise. * gensymlist.sh: Likewise. * term/i386/pc/vga.c: Indent correctly. * util/i386/pc/pupa-mkimage.c (usage): Use PACKAGE_BUGREPORT as bugreporting address. * util/i386/pc/pupa-setup.c (usage): Likewise, (main): Call pupa_ext2_init and pupa_ext2_fini. * fs/fat.c (log2): Renamed to ... (fat_log2): ... this. All callers changed. * kern/misc.c (memcpy): Alias to pupa_memmove. * loader/i386/pc/multiboot.c (pupa_rescue_cmd_multiboot): Fix lvalue cast. * util/console.c (pupa_ncurses_fini): Return 0. * util/i386/pc/biosdisk.c (pupa_util_biosdisk_open)[__linux__]: Move fail label here. [__GNU__]: Don't warn when using stat. (open_device)[!__linux__]: Check if FD < 0 instead of !FD. (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to long int. Use strtol instead of strtoul.
This commit is contained in:
parent
db1771cfbe
commit
8c8cc20511
12 changed files with 149 additions and 115 deletions
9
fs/fat.c
9
fs/fat.c
|
@ -1,7 +1,7 @@
|
|||
/* fat.c - FAT filesystem */
|
||||
/*
|
||||
* PUPA -- Preliminary Universal Programming Architecture for GRUB
|
||||
* Copyright (C) 2000,2001,2002,2003 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2000,2001,2002,2003,2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -130,7 +130,7 @@ static pupa_dl_t my_mod;
|
|||
#endif
|
||||
|
||||
static int
|
||||
log2 (unsigned x)
|
||||
fat_log2 (unsigned x)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -165,12 +165,13 @@ pupa_fat_mount (pupa_disk_t disk)
|
|||
goto fail;
|
||||
|
||||
/* Get the sizes of logical sectors and clusters. */
|
||||
data->logical_sector_bits = log2 (pupa_le_to_cpu16 (bpb.bytes_per_sector));
|
||||
data->logical_sector_bits =
|
||||
fat_log2 (pupa_le_to_cpu16 (bpb.bytes_per_sector));
|
||||
if (data->logical_sector_bits < PUPA_DISK_SECTOR_BITS)
|
||||
goto fail;
|
||||
data->logical_sector_bits -= PUPA_DISK_SECTOR_BITS;
|
||||
|
||||
data->cluster_bits = log2 (bpb.sectors_per_cluster);
|
||||
data->cluster_bits = fat_log2 (bpb.sectors_per_cluster);
|
||||
if (data->cluster_bits < 0)
|
||||
goto fail;
|
||||
data->cluster_bits += data->logical_sector_bits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue