Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] long
This brings us in to line with Linux definitions, and also simplifies
adding x86_64 support since both platforms have 2-byte shorts, 4-byte
ints and 8-byte long longs.
  • Loading branch information
Michael Brown committed Nov 19, 2008
1 parent 849e4b1 commit b59e0cc
Show file tree
Hide file tree
Showing 45 changed files with 157 additions and 157 deletions.
4 changes: 2 additions & 2 deletions src/arch/i386/core/dumpregs.c
Expand Up @@ -12,8 +12,8 @@ void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) {
"addr32 leal 4(%%esp), %%esp\n\t"
"ret\n\t" ) : : );

printf ( "EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
"ESI=%08lx EDI=%08lx EBP=%08lx ESP=%08lx\n"
printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
"ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"
"CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x\n",
ix86->regs.eax, ix86->regs.ebx, ix86->regs.ecx,
ix86->regs.edx, ix86->regs.esi, ix86->regs.edi,
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/drivers/net/undinet.c
Expand Up @@ -701,7 +701,7 @@ int undinet_probe ( struct undi_device *undi ) {
&undi_iface,
sizeof ( undi_iface ) ) ) != 0 )
goto err_undi_get_iface_info;
DBGC ( undinic, "UNDINIC %p has type %s and link speed %ld\n",
DBGC ( undinic, "UNDINIC %p has type %s and link speed %d\n",
undinic, undi_iface.IfaceType, undi_iface.LinkSpeed );
if ( strncmp ( ( ( char * ) undi_iface.IfaceType ), "Etherboot",
sizeof ( undi_iface.IfaceType ) ) == 0 ) {
Expand Down
4 changes: 2 additions & 2 deletions src/arch/i386/drivers/net/undirom.c
Expand Up @@ -52,7 +52,7 @@ static int undirom_parse_pxeromid ( struct undi_rom *undirom,
sizeof ( undi_rom_id ) );
if ( undi_rom_id.Signature != UNDI_ROM_ID_SIGNATURE ) {
DBGC ( undirom, "UNDIROM %p has bad PXE ROM ID signature "
"%08lx\n", undirom, undi_rom_id.Signature );
"%08x\n", undirom, undi_rom_id.Signature );
return -EINVAL;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ static int undirom_parse_pcirheader ( struct undi_rom *undirom,
sizeof ( pcir_header ) );
if ( pcir_header.signature != PCIR_SIGNATURE ) {
DBGC ( undirom, "UNDIROM %p has bad PCI expansion header "
"signature %08lx\n", undirom, pcir_header.signature );
"signature %08x\n", undirom, pcir_header.signature );
return -EINVAL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/firmware/pcbios/memmap.c
Expand Up @@ -210,7 +210,7 @@ static int meme820 ( struct memory_map *memmap ) {
if ( e820buf.attrs & E820_ATTR_NONVOLATILE )
DBG ( ", non-volatile" );
if ( e820buf.attrs & E820_ATTR_UNKNOWN )
DBG ( ", other [%08lx]", e820buf.attrs );
DBG ( ", other [%08x]", e820buf.attrs );
DBG ( ")" );
}
DBG ( "\n" );
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/image/bzimage.c
Expand Up @@ -400,7 +400,7 @@ static int bzimage_load_header ( struct image *image,
copy_from_user ( bzhdr, image->data, BZI_HDR_OFFSET,
sizeof ( *bzhdr ) );
if ( bzhdr->header != BZI_SIGNATURE ) {
DBGC ( image, "bzImage %p bad signature %08lx\n",
DBGC ( image, "bzImage %p bad signature %08x\n",
image, bzhdr->header );
return -ENOEXEC;
}
Expand Down
6 changes: 3 additions & 3 deletions src/arch/i386/image/multiboot.c
Expand Up @@ -220,7 +220,7 @@ multiboot_build_module_list ( struct image *image,

/* Dump module configuration */
for ( i = 0 ; i < count ; i++ ) {
DBGC ( image, "MULTIBOOT %p module %d is [%lx,%lx)\n",
DBGC ( image, "MULTIBOOT %p module %d is [%x,%x)\n",
image, i, modules[i].mod_start,
modules[i].mod_end );
}
Expand Down Expand Up @@ -418,7 +418,7 @@ static int multiboot_load ( struct image *image ) {
image );
return rc;
}
DBGC ( image, "MULTIBOOT %p found header with flags %08lx\n",
DBGC ( image, "MULTIBOOT %p found header with flags %08x\n",
image, hdr.mb.flags );

/* This is a multiboot image, valid or otherwise */
Expand All @@ -427,7 +427,7 @@ static int multiboot_load ( struct image *image ) {

/* Abort if we detect flags that we cannot support */
if ( hdr.mb.flags & MB_UNSUPPORTED_FLAGS ) {
DBGC ( image, "MULTIBOOT %p flags %08lx not supported\n",
DBGC ( image, "MULTIBOOT %p flags %08x not supported\n",
image, ( hdr.mb.flags & MB_UNSUPPORTED_FLAGS ) );
return -ENOTSUP;
}
Expand Down
4 changes: 2 additions & 2 deletions src/arch/i386/include/bits/stdint.h
Expand Up @@ -7,12 +7,12 @@ typedef signed long off_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;

typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int32_t;
typedef signed int int32_t;
typedef signed long long int64_t;

typedef unsigned long physaddr_t;
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/include/gdbmach.h
Expand Up @@ -12,7 +12,7 @@

#include <stdint.h>

typedef uint32_t gdbreg_t;
typedef unsigned long gdbreg_t;

/* The register snapshot, this must be in sync with interrupt handler and the
* GDB protocol. */
Expand Down
2 changes: 1 addition & 1 deletion src/arch/i386/interface/pxe/pxe_tftp.c
Expand Up @@ -485,7 +485,7 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
*tftp_read_file ) {
int rc;

DBG ( "PXENV_TFTP_READ_FILE to %08lx+%lx", tftp_read_file->Buffer,
DBG ( "PXENV_TFTP_READ_FILE to %08x+%x", tftp_read_file->Buffer,
tftp_read_file->BufferSize );

/* Open TFTP file */
Expand Down
4 changes: 2 additions & 2 deletions src/core/debug.c
Expand Up @@ -106,12 +106,12 @@ int check_region ( void *region, size_t len ) {
virt_to_phys ( region + len ) );
}
in_corruption = 1;
printf ( "--- offset %#lx ", offset );
printf ( "--- offset %#x ", offset );
} else if ( ( in_corruption != 0 ) &&
( test == GUARD_SYMBOL ) ) {
/* End of corruption */
in_corruption = 0;
printf ( "to offset %#lx", offset );
printf ( "to offset %#x", offset );
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/core/uuid.c
Expand Up @@ -36,7 +36,7 @@
char * uuid_ntoa ( union uuid *uuid ) {
static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */

sprintf ( buf, "%08lx-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
sprintf ( buf, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
be32_to_cpu ( uuid->canonical.a ),
be16_to_cpu ( uuid->canonical.b ),
be16_to_cpu ( uuid->canonical.c ),
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/bus/isapnp.c
Expand Up @@ -84,7 +84,7 @@ static void isapnpbus_remove ( struct root_device *rootdev );
*
*/

#define ISAPNP_CARD_ID_FMT "ID %04x:%04x (\"%s\") serial %lx"
#define ISAPNP_CARD_ID_FMT "ID %04x:%04x (\"%s\") serial %x"
#define ISAPNP_CARD_ID_DATA(identifier) \
(identifier)->vendor_id, (identifier)->prod_id, \
isa_id_string ( (identifier)->vendor_id, (identifier)->prod_id ), \
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/bus/pci.c
Expand Up @@ -67,7 +67,7 @@ static unsigned long pci_bar ( struct pci_device *pci, unsigned int reg ) {
if ( sizeof ( unsigned long ) > sizeof ( uint32_t ) ) {
return ( ( ( uint64_t ) high << 32 ) | low );
} else {
DBG ( "Unhandled 64-bit BAR %08lx%08lx\n",
DBG ( "Unhandled 64-bit BAR %08x%08x\n",
high, low );
return PCI_BASE_ADDRESS_MEM_TYPE_64;
}
Expand Down
8 changes: 4 additions & 4 deletions src/drivers/infiniband/arbel.c
Expand Up @@ -992,7 +992,7 @@ static void arbel_ring_doorbell ( struct arbel *arbel,
union arbelprm_doorbell_register *db_reg,
unsigned int offset ) {

DBGC2 ( arbel, "Arbel %p ringing doorbell %08lx:%08lx at %lx\n",
DBGC2 ( arbel, "Arbel %p ringing doorbell %08x:%08x at %lx\n",
arbel, db_reg->dword[0], db_reg->dword[1],
virt_to_phys ( arbel->uar + offset ) );

Expand Down Expand Up @@ -1182,7 +1182,7 @@ static int arbel_complete ( struct ib_device *ibdev,
if ( opcode >= ARBEL_OPCODE_RECV_ERROR ) {
/* "s" field is not valid for error opcodes */
is_send = ( opcode == ARBEL_OPCODE_SEND_ERROR );
DBGC ( arbel, "Arbel %p CPN %lx syndrome %lx vendor %lx\n",
DBGC ( arbel, "Arbel %p CPN %lx syndrome %x vendor %x\n",
arbel, cq->cqn, MLX_GET ( &cqe->error, syndrome ),
MLX_GET ( &cqe->error, vendor_code ) );
rc = -EIO;
Expand Down Expand Up @@ -1492,7 +1492,7 @@ static void arbel_poll_eq ( struct ib_device *ibdev ) {

/* Ring doorbell */
MLX_FILL_1 ( &db_reg.ci, 0, ci, arbel_eq->next_idx );
DBGCP ( arbel, "Ringing doorbell %08lx with %08lx\n",
DBGCP ( arbel, "Ringing doorbell %08lx with %08x\n",
virt_to_phys ( arbel_eq->doorbell ),
db_reg.dword[0] );
writel ( db_reg.dword[0], arbel_eq->doorbell );
Expand Down Expand Up @@ -1696,7 +1696,7 @@ static int arbel_start_firmware ( struct arbel *arbel ) {
arbel, strerror ( rc ) );
goto err_query_fw;
}
DBGC ( arbel, "Arbel %p firmware version %ld.%ld.%ld\n", arbel,
DBGC ( arbel, "Arbel %p firmware version %d.%d.%d\n", arbel,
MLX_GET ( &fw, fw_rev_major ), MLX_GET ( &fw, fw_rev_minor ),
MLX_GET ( &fw, fw_rev_subminor ) );
fw_pages = MLX_GET ( &fw, fw_pages );
Expand Down
8 changes: 4 additions & 4 deletions src/drivers/infiniband/hermon.c
Expand Up @@ -1086,7 +1086,7 @@ static int hermon_post_send ( struct ib_device *ibdev,

/* Ring doorbell register */
MLX_FILL_1 ( &db_reg.send, 0, qn, qp->qpn );
DBGCP ( hermon, "Ringing doorbell %08lx with %08lx\n",
DBGCP ( hermon, "Ringing doorbell %08lx with %08x\n",
virt_to_phys ( hermon_send_wq->doorbell ), db_reg.dword[0] );
writel ( db_reg.dword[0], ( hermon_send_wq->doorbell ) );

Expand Down Expand Up @@ -1172,7 +1172,7 @@ static int hermon_complete ( struct ib_device *ibdev,
if ( opcode >= HERMON_OPCODE_RECV_ERROR ) {
/* "s" field is not valid for error opcodes */
is_send = ( opcode == HERMON_OPCODE_SEND_ERROR );
DBGC ( hermon, "Hermon %p CQN %lx syndrome %lx vendor %lx\n",
DBGC ( hermon, "Hermon %p CQN %lx syndrome %x vendor %x\n",
hermon, cq->cqn, MLX_GET ( &cqe->error, syndrome ),
MLX_GET ( &cqe->error, vendor_error_syndrome ) );
rc = -EIO;
Expand Down Expand Up @@ -1473,7 +1473,7 @@ static void hermon_poll_eq ( struct ib_device *ibdev ) {
/* Ring doorbell */
MLX_FILL_1 ( &db_reg.event, 0,
ci, ( hermon_eq->next_idx & 0x00ffffffUL ) );
DBGCP ( hermon, "Ringing doorbell %08lx with %08lx\n",
DBGCP ( hermon, "Ringing doorbell %08lx with %08x\n",
virt_to_phys ( hermon_eq->doorbell ),
db_reg.dword[0] );
writel ( db_reg.dword[0], hermon_eq->doorbell );
Expand Down Expand Up @@ -1714,7 +1714,7 @@ static int hermon_start_firmware ( struct hermon *hermon ) {
hermon, strerror ( rc ) );
goto err_query_fw;
}
DBGC ( hermon, "Hermon %p firmware version %ld.%ld.%ld\n", hermon,
DBGC ( hermon, "Hermon %p firmware version %d.%d.%d\n", hermon,
MLX_GET ( &fw, fw_rev_major ), MLX_GET ( &fw, fw_rev_minor ),
MLX_GET ( &fw, fw_rev_subminor ) );
fw_pages = MLX_GET ( &fw, fw_pages );
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/infiniband/ib_packet.c
Expand Up @@ -222,7 +222,7 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
}
}

DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08lx)\n",
DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
ibdev, lid,
( IB_LID_MULTICAST( lid ) ? ( qp ? (*qp)->qpn : -1UL ) : qpn ),
av->lid, av->qpn, ntohl ( deth->qkey ) );
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/infiniband/ib_sma.c
Expand Up @@ -269,7 +269,7 @@ static int ib_sma_mad ( struct ib_sma *sma, union ib_mad *mad ) {
int rc;

DBGC ( sma, "SMA %p received SMP with bv=%02x mc=%02x cv=%02x "
"meth=%02x attr=%04x mod=%08lx\n", sma, hdr->base_version,
"meth=%02x attr=%04x mod=%08x\n", sma, hdr->base_version,
hdr->mgmt_class, hdr->class_version, hdr->method,
ntohs ( hdr->attr_id ), ntohl ( hdr->attr_mod ) );
DBGC2_HDA ( sma, 0, mad, sizeof ( *mad ) );
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/infiniband/ib_smc.c
Expand Up @@ -156,7 +156,7 @@ int ib_smc_update ( struct ib_device *ibdev, ib_local_mad_t local_mad ) {
return rc;
ibdev->pkey = ntohs ( smp->pkey_table.pkey[0] );

DBGC ( ibdev, "IBDEV %p port GID is %08lx:%08lx:%08lx:%08lx\n", ibdev,
DBGC ( ibdev, "IBDEV %p port GID is %08x:%08x:%08x:%08x\n", ibdev,
htonl ( ibdev->gid.u.dwords[0] ),
htonl ( ibdev->gid.u.dwords[1] ),
htonl ( ibdev->gid.u.dwords[2] ),
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/infiniband/linda.c
Expand Up @@ -129,7 +129,7 @@ static void linda_readq ( struct linda *linda, uint32_t *dwords,
"movq %%mm0, (%0)\n\t"
: : "r" ( dwords ), "r" ( addr ) : "memory" );

DBGIO ( "[%08lx] => %08lx%08lx\n",
DBGIO ( "[%08lx] => %08x%08x\n",
virt_to_phys ( addr ), dwords[1], dwords[0] );
}
#define linda_readq( _linda, _ptr, _offset ) \
Expand All @@ -150,7 +150,7 @@ static void linda_writeq ( struct linda *linda, const uint32_t *dwords,
unsigned long offset ) {
void *addr = ( linda->regs + offset );

DBGIO ( "[%08lx] <= %08lx%08lx\n",
DBGIO ( "[%08lx] <= %08x%08x\n",
virt_to_phys ( addr ), dwords[1], dwords[0] );

__asm__ __volatile__ ( "movq (%0), %%mm0\n\t"
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/net/3c515.c
Expand Up @@ -640,7 +640,7 @@ static int t515_probe ( struct nic *nic, struct isapnp_device *isapnp ) {
}

}
DBG ( "3c515 Resource configuration register 0x%lX, DCR 0x%hX.\n",
DBG ( "3c515 Resource configuration register 0x%X, DCR 0x%hX.\n",
inl(nic->ioaddr + 0x2002), inw(nic->ioaddr + 0x2000) );
corkscrew_found_device(nic->ioaddr, nic->irqno, CORKSCREW_ID,
options, nic);
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/net/davicom.c
Expand Up @@ -630,7 +630,7 @@ static void davicom_disable ( struct nic *nic ) {
outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);

/* Clear the missed-packet counter. */
(volatile unsigned long)inl(ioaddr + CSR8);
inl(ioaddr + CSR8);
}


Expand Down Expand Up @@ -676,7 +676,7 @@ static int davicom_probe ( struct nic *nic, struct pci_device *pci ) {
outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);

/* Clear the missed-packet counter. */
(volatile unsigned long)inl(ioaddr + CSR8);
inl(ioaddr + CSR8);

/* Get MAC Address */
/* read EEPROM data */
Expand Down

0 comments on commit b59e0cc

Please sign in to comment.