Changeset View
Changeset View
Standalone View
Standalone View
stand/i386/libi386/biosdisk.c
Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | if (!V86_CY(v86.efl)) { | ||||
if (params.sectors != 0) { | if (params.sectors != 0) { | ||||
/* Only update if we did not overflow. */ | /* Only update if we did not overflow. */ | ||||
if (total > params.sectors) | if (total > params.sectors) | ||||
bd->bd_sectors = params.sectors; | bd->bd_sectors = params.sectors; | ||||
} | } | ||||
total = (uint64_t)params.cylinders * | total = (uint64_t)params.cylinders * | ||||
params.heads * params.sectors_per_track; | params.heads * params.sectors_per_track; | ||||
if (bd->bd_sectors > total) | if (total > 0 && bd->bd_sectors > total) | ||||
bd->bd_sectors = total; | bd->bd_sectors = total; | ||||
ret = 1; | ret = 1; | ||||
} | } | ||||
DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", | DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", | ||||
bd->bd_unit, bd->bd_flags, bd->bd_sectors, bd->bd_sectorsize); | bd->bd_unit, bd->bd_flags, bd->bd_sectors, bd->bd_sectorsize); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 539 Lines • Show Last 20 Lines |