64-bit compilation fixes for BFS, add to x86_64 boot image.

This commit is contained in:
Alex Smith 2012-07-22 10:42:35 +01:00
parent 59ae45c1ab
commit 1c24ebaa5f
5 changed files with 41 additions and 39 deletions

View File

@ -58,7 +58,7 @@ if $(TARGET_ARCH) = x86_64 {
AddFilesToFloppyBootArchive system add-ons kernel busses ata AddFilesToFloppyBootArchive system add-ons kernel busses ata
: generic_ide_pci ; : generic_ide_pci ;
AddFilesToFloppyBootArchive system add-ons kernel file_systems AddFilesToFloppyBootArchive system add-ons kernel file_systems
: iso9660 attribute_overlay write_overlay ; : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToFloppyBootArchive system add-ons kernel generic AddFilesToFloppyBootArchive system add-ons kernel generic
: ata_adapter locked_pool scsi_periph ; : ata_adapter locked_pool scsi_periph ;
AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems
@ -148,8 +148,8 @@ if $(NET_BOOT) = 1 {
if $(TARGET_ARCH) = x86_64 { if $(TARGET_ARCH) = x86_64 {
AddBootModuleSymlinksToFloppyBootArchive AddBootModuleSymlinksToFloppyBootArchive
ata dpc config_manager pci scsi ata_adapter locked_pool scsi_periph ata dpc config_manager pci scsi ata_adapter locked_pool scsi_periph
generic_x86 generic_ide_pci scsi_cd scsi_disk intel session iso9660 generic_x86 generic_ide_pci scsi_cd scsi_disk intel session
attribute_overlay write_overlay $(SYSTEM_ADD_ONS_FILE_SYSTEMS)
; ;
} else { } else {
AddBootModuleSymlinksToFloppyBootArchive AddBootModuleSymlinksToFloppyBootArchive

View File

@ -767,7 +767,7 @@ BPlusTree::Validate(bool repair, bool& _errorsFound)
fHeader.MaxNumberOfLevels()); fHeader.MaxNumberOfLevels());
} }
if (check.VisitedCount() != fHeader.MaximumSize() / fNodeSize) { if ((off_t)check.VisitedCount() != fHeader.MaximumSize() / fNodeSize) {
dprintf("inode %" B_PRIdOFF ": visited %" B_PRIuSIZE " from %" B_PRIdOFF dprintf("inode %" B_PRIdOFF ": visited %" B_PRIuSIZE " from %" B_PRIdOFF
" nodes.\n", fStream->ID(), check.VisitedCount(), " nodes.\n", fStream->ID(), check.VisitedCount(),
fHeader.MaximumSize() / fNodeSize); fHeader.MaximumSize() / fNodeSize);
@ -791,7 +791,7 @@ BPlusTree::MakeEmpty()
header->max_number_of_levels = HOST_ENDIAN_TO_BFS_INT32(1); header->max_number_of_levels = HOST_ENDIAN_TO_BFS_INT32(1);
header->root_node_pointer = HOST_ENDIAN_TO_BFS_INT64(NodeSize()); header->root_node_pointer = HOST_ENDIAN_TO_BFS_INT64(NodeSize());
if (fStream->Size() > NodeSize() * 2) if (fStream->Size() > (off_t)NodeSize() * 2)
header->free_node_pointer = HOST_ENDIAN_TO_BFS_INT64(2 * NodeSize()); header->free_node_pointer = HOST_ENDIAN_TO_BFS_INT64(2 * NodeSize());
else { else {
header->free_node_pointer header->free_node_pointer
@ -812,10 +812,10 @@ BPlusTree::MakeEmpty()
offset += NodeSize()) { offset += NodeSize()) {
bplustree_node* node = cached.SetToWritable(transaction, offset, false); bplustree_node* node = cached.SetToWritable(transaction, offset, false);
if (node == NULL) { if (node == NULL) {
dprintf("--> could not open %lld\n", offset); dprintf("--> could not open %" B_PRIdOFF "\n", offset);
return B_IO_ERROR; return B_IO_ERROR;
} }
if (offset < fStream->Size() - NodeSize()) if (offset < fStream->Size() - (off_t)NodeSize())
node->left_link = HOST_ENDIAN_TO_BFS_INT64(offset + NodeSize()); node->left_link = HOST_ENDIAN_TO_BFS_INT64(offset + NodeSize());
else else
node->left_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL); node->left_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
@ -2910,8 +2910,8 @@ bplustree_node::CheckIntegrity(uint32 nodeSize) const
return B_BAD_DATA; return B_BAD_DATA;
} }
if (Values()[i] == -1) { if (Values()[i] == -1) {
dprintf("invalid node %p, value %d: %lld: values corrupted\n", dprintf("invalid node %p, value %d: %" B_PRIdOFF ": values "
this, (int)i, Values()[i]); "corrupted\n", this, (int)i, Values()[i]);
return B_BAD_DATA; return B_BAD_DATA;
} }
} }

View File

@ -2131,8 +2131,8 @@ BlockAllocator::_AddInodeToIndex(Inode* inode)
void void
BlockAllocator::Dump(int32 index) BlockAllocator::Dump(int32 index)
{ {
kprintf("allocation groups: %ld (base %p)\n", fNumGroups, fGroups); kprintf("allocation groups: %" B_PRId32 " (base %p)\n", fNumGroups, fGroups);
kprintf("blocks per group: %ld\n", fBlocksPerGroup); kprintf("blocks per group: %" B_PRId32 "\n", fBlocksPerGroup);
for (int32 i = 0; i < fNumGroups; i++) { for (int32 i = 0; i < fNumGroups; i++) {
if (index != -1 && i != index) if (index != -1 && i != index)
@ -2140,15 +2140,15 @@ BlockAllocator::Dump(int32 index)
AllocationGroup& group = fGroups[i]; AllocationGroup& group = fGroups[i];
kprintf("[%3ld] num bits: %lu (%p)\n", i, group.NumBits(), kprintf("[%3" B_PRId32 "] num bits: %" B_PRIu32 " (%p)\n", i,
&group); group.NumBits(), &group);
kprintf(" num blocks: %lu\n", group.NumBlocks()); kprintf(" num blocks: %" B_PRIu32 "\n", group.NumBlocks());
kprintf(" start: %ld\n", group.Start()); kprintf(" start: %" B_PRId32 "\n", group.Start());
kprintf(" first free: %ld\n", group.fFirstFree); kprintf(" first free: %" B_PRId32 "\n", group.fFirstFree);
kprintf(" largest start: %ld%s\n", group.fLargestStart, kprintf(" largest start: %" B_PRId32 "%s\n", group.fLargestStart,
group.fLargestValid ? "" : " (invalid)"); group.fLargestValid ? "" : " (invalid)");
kprintf(" largest length: %ld\n", group.fLargestLength); kprintf(" largest length: %" B_PRId32 "\n", group.fLargestLength);
kprintf(" free bits: %ld\n", group.fFreeBits); kprintf(" free bits: %" B_PRId32 "\n", group.fFreeBits);
} }
} }

View File

@ -299,8 +299,9 @@ dump_inode(int argc, char** argv)
kprintf(" tree: %p\n", inode->Tree()); kprintf(" tree: %p\n", inode->Tree());
kprintf(" file cache: %p\n", inode->FileCache()); kprintf(" file cache: %p\n", inode->FileCache());
kprintf(" file map: %p\n", inode->Map()); kprintf(" file map: %p\n", inode->Map());
kprintf(" old size: %Ld\n", inode->OldSize()); kprintf(" old size: %" B_PRIdOFF "\n", inode->OldSize());
kprintf(" old last modified: %Ld\n", inode->OldLastModified()); kprintf(" old last modified: %" B_PRIdOFF "\n",
inode->OldLastModified());
node = &inode->Node(); node = &inode->Node();
} }
@ -334,8 +335,9 @@ dump_volume(int argc, char** argv)
run.start = HOST_ENDIAN_TO_BFS_INT16(strtoul(arg + 1, NULL, 0)); run.start = HOST_ENDIAN_TO_BFS_INT16(strtoul(arg + 1, NULL, 0));
run.length = 0; run.length = 0;
kprintf("%ld.%u -> block %Ld, bitmap block %ld\n", kprintf("%" B_PRId32 ".%u -> block %" B_PRIdOFF ", bitmap block"
run.AllocationGroup(), run.Start(), volume->ToBlock(run), " %" B_PRId32 "\n", run.AllocationGroup(), run.Start(),
volume->ToBlock(run),
volume->SuperBlock().BlocksPerAllocationGroup() volume->SuperBlock().BlocksPerAllocationGroup()
* run.AllocationGroup() + 1); * run.AllocationGroup() + 1);
} else { } else {
@ -343,16 +345,16 @@ dump_volume(int argc, char** argv)
off_t offset = parse_expression(arg); off_t offset = parse_expression(arg);
block_run run = volume->ToBlockRun(offset); block_run run = volume->ToBlockRun(offset);
kprintf("block %Ld -> %ld.%u, bitmap block %ld\n", offset, kprintf("block %" B_PRIdOFF " -> %" B_PRId32 ".%u, bitmap block"
run.AllocationGroup(), run.Start(), " %" B_PRId32 "\n", offset, run.AllocationGroup(),
volume->SuperBlock().BlocksPerAllocationGroup() run.Start(), volume->SuperBlock().BlocksPerAllocationGroup()
* run.AllocationGroup() + 1); * run.AllocationGroup() + 1);
} }
} }
return 0; return 0;
} }
kprintf("id: %ld\n", volume->ID()); kprintf("id: %" B_PRId32 "\n", volume->ID());
kprintf("block cache: %p\n", volume->BlockCache()); kprintf("block cache: %p\n", volume->BlockCache());
kprintf("journal: %p\n", volume->GetJournal(0)); kprintf("journal: %p\n", volume->GetJournal(0));
kprintf("allocator: %p\n", &volume->Allocator()); kprintf("allocator: %p\n", &volume->Allocator());
@ -397,9 +399,9 @@ dump_block_run_array(int argc, char** argv)
for (uint32 i = 0; i < count; i++) { for (uint32 i = 0; i < count; i++) {
if (blockSize != 0) if (blockSize != 0)
dprintf("[%3lu] %10" B_PRIdOFF " ", i, offset); dprintf("[%3" B_PRIu32 "] %10" B_PRIdOFF " ", i, offset);
else else
dprintf("[%3lu] ", i); dprintf("[%3" B_PRIu32 "] ", i);
uint32 size = runs[i].Length() * blockSize; uint32 size = runs[i].Length() * blockSize;
if (searchOffset != 0 && searchOffset >= offset if (searchOffset != 0 && searchOffset >= offset

View File

@ -1083,15 +1083,15 @@ void
Journal::Dump() Journal::Dump()
{ {
kprintf("Journal %p\n", this); kprintf("Journal %p\n", this);
kprintf(" log start: %ld\n", fVolume->LogStart()); kprintf(" log start: %" B_PRId32 "\n", fVolume->LogStart());
kprintf(" log end: %ld\n", fVolume->LogEnd()); kprintf(" log end: %" B_PRId32 "\n", fVolume->LogEnd());
kprintf(" owner: %p\n", fOwner); kprintf(" owner: %p\n", fOwner);
kprintf(" log size: %lu\n", fLogSize); kprintf(" log size: %" B_PRIu32 "\n", fLogSize);
kprintf(" max transaction size: %lu\n", fMaxTransactionSize); kprintf(" max transaction size: %" B_PRIu32 "\n", fMaxTransactionSize);
kprintf(" used: %lu\n", fUsed); kprintf(" used: %" B_PRIu32 "\n", fUsed);
kprintf(" unwritten: %ld\n", fUnwrittenTransactions); kprintf(" unwritten: %" B_PRId32 "\n", fUnwrittenTransactions);
kprintf(" timestamp: %lld\n", fTimestamp); kprintf(" timestamp: %" B_PRId64 "\n", fTimestamp);
kprintf(" transaction ID: %ld\n", fTransactionID); kprintf(" transaction ID: %" B_PRId32 "\n", fTransactionID);
kprintf(" has subtransaction: %d\n", fHasSubtransaction); kprintf(" has subtransaction: %d\n", fHasSubtransaction);
kprintf(" separate sub-trans.: %d\n", fSeparateSubTransactions); kprintf(" separate sub-trans.: %d\n", fSeparateSubTransactions);
kprintf("entries:\n"); kprintf("entries:\n");
@ -1102,8 +1102,8 @@ Journal::Dump()
while (iterator.HasNext()) { while (iterator.HasNext()) {
LogEntry* entry = iterator.Next(); LogEntry* entry = iterator.Next();
kprintf(" %p %6ld %6lu %6lu\n", entry, entry->TransactionID(), kprintf(" %p %6" B_PRId32 " %6" B_PRIu32 " %6" B_PRIu32 "\n", entry,
entry->Start(), entry->Length()); entry->TransactionID(), entry->Start(), entry->Length());
} }
} }