mirror of
https://github.com/ipxe/ipxe
synced 2026-02-10 21:28:44 +03:00
[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.
This commit is contained in:
@@ -224,7 +224,7 @@ static int efi_getchar ( void ) {
|
||||
|
||||
/* Read key from real EFI console */
|
||||
if ( ( efirc = conin->ReadKeyStroke ( conin, &key ) ) != 0 ) {
|
||||
DBG ( "EFI could not read keystroke: %lx\n", efirc );
|
||||
DBG ( "EFI could not read keystroke: %x\n", efirc );
|
||||
return 0;
|
||||
}
|
||||
DBG2 ( "EFI read key stroke with unicode %04x scancode %04x\n",
|
||||
|
||||
@@ -86,7 +86,7 @@ unsigned long long efi_ioread ( volatile void *io_addr, size_t size ) {
|
||||
if ( ( efirc = read ( cpu_io, efi_width ( size ),
|
||||
( intptr_t ) io_addr, 1,
|
||||
( void * ) &data ) ) != 0 ) {
|
||||
DBG ( "EFI I/O read at %p failed: %lx\n", io_addr, efirc );
|
||||
DBG ( "EFI I/O read at %p failed: %x\n", io_addr, efirc );
|
||||
return -1ULL;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void efi_iowrite ( unsigned long long data, volatile void *io_addr,
|
||||
if ( ( efirc = write ( cpu_io, efi_width ( size ),
|
||||
( intptr_t ) io_addr, 1,
|
||||
( void * ) &data ) ) != 0 ) {
|
||||
DBG ( "EFI I/O write at %p failed: %lx\n", io_addr, efirc );
|
||||
DBG ( "EFI I/O write at %p failed: %x\n", io_addr, efirc );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void efi_ioreads ( volatile void *io_addr, void *data,
|
||||
if ( ( efirc = read ( cpu_io, efi_width ( size ),
|
||||
( intptr_t ) io_addr, count,
|
||||
( void * ) data ) ) != 0 ) {
|
||||
DBG ( "EFI I/O string read at %p failed: %lx\n",
|
||||
DBG ( "EFI I/O string read at %p failed: %x\n",
|
||||
io_addr, efirc );
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ void efi_iowrites ( volatile void *io_addr, const void *data,
|
||||
if ( ( efirc = write ( cpu_io, efi_width ( size ),
|
||||
( intptr_t ) io_addr, count,
|
||||
( void * ) data ) ) != 0 ) {
|
||||
DBG ( "EFI I/O write at %p failed: %lx\n",
|
||||
DBG ( "EFI I/O write at %p failed: %x\n",
|
||||
io_addr, efirc );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ int efipci_read ( struct pci_device *pci, unsigned long location,
|
||||
efipci_address ( pci, location ), 1,
|
||||
value ) ) != 0 ) {
|
||||
DBG ( "EFIPCI config read from %02x:%02x.%x offset %02lx "
|
||||
"failed: %lx\n", pci->bus, PCI_SLOT ( pci->devfn ),
|
||||
"failed: %x\n", pci->bus, PCI_SLOT ( pci->devfn ),
|
||||
PCI_FUNC ( pci->devfn ), EFIPCI_OFFSET ( location ),
|
||||
efirc );
|
||||
return -EIO;
|
||||
@@ -63,7 +63,7 @@ int efipci_write ( struct pci_device *pci, unsigned long location,
|
||||
efipci_address ( pci, location ), 1,
|
||||
&value ) ) != 0 ) {
|
||||
DBG ( "EFIPCI config write to %02x:%02x.%x offset %02lx "
|
||||
"failed: %lx\n", pci->bus, PCI_SLOT ( pci->devfn ),
|
||||
"failed: %x\n", pci->bus, PCI_SLOT ( pci->devfn ),
|
||||
PCI_FUNC ( pci->devfn ), EFIPCI_OFFSET ( location ),
|
||||
efirc );
|
||||
return -EIO;
|
||||
|
||||
@@ -173,7 +173,7 @@ efi_snp_initialize ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
container_of ( snp, struct efi_snp_device, snp );
|
||||
int rc;
|
||||
|
||||
DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%ld extra RX, %ld extra TX)\n",
|
||||
DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%d extra RX, %d extra TX)\n",
|
||||
snpdev, extra_rx_bufsize, extra_tx_bufsize );
|
||||
|
||||
if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
|
||||
@@ -252,7 +252,7 @@ efi_snp_receive_filters ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, UINT32 enable,
|
||||
container_of ( snp, struct efi_snp_device, snp );
|
||||
unsigned int i;
|
||||
|
||||
DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08lx&~%08lx%s %ld mcast\n",
|
||||
DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %d mcast\n",
|
||||
snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
|
||||
mcast_count );
|
||||
for ( i = 0 ; i < mcast_count ; i++ ) {
|
||||
@@ -390,7 +390,7 @@ efi_snp_nvdata ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, BOOLEAN read,
|
||||
struct efi_snp_device *snpdev =
|
||||
container_of ( snp, struct efi_snp_device, snp );
|
||||
|
||||
DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %lx+%lx\n", snpdev,
|
||||
DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %x+%x\n", snpdev,
|
||||
( read ? "read" : "write" ), offset, len );
|
||||
if ( ! read )
|
||||
DBGC2_HDA ( snpdev, offset, data, len );
|
||||
@@ -435,7 +435,7 @@ efi_snp_get_status ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
*interrupts |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;
|
||||
snpdev->rx_count_interrupts--;
|
||||
}
|
||||
DBGC2 ( snpdev, " INTS:%02lx", *interrupts );
|
||||
DBGC2 ( snpdev, " INTS:%02x", *interrupts );
|
||||
}
|
||||
|
||||
/* TX completions. It would be possible to design a more
|
||||
@@ -492,7 +492,7 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
int rc;
|
||||
EFI_STATUS efirc;
|
||||
|
||||
DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%lx", snpdev, data, len );
|
||||
DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%x", snpdev, data, len );
|
||||
if ( ll_header_len ) {
|
||||
if ( ll_src ) {
|
||||
DBGC2 ( snpdev, " src %s",
|
||||
@@ -512,12 +512,12 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
if ( ll_header_len ) {
|
||||
if ( ll_header_len != ll_protocol->ll_header_len ) {
|
||||
DBGC ( snpdev, "SNPDEV %p TX invalid header length "
|
||||
"%ld\n", snpdev, ll_header_len );
|
||||
"%d\n", snpdev, ll_header_len );
|
||||
efirc = EFI_INVALID_PARAMETER;
|
||||
goto err_sanity;
|
||||
}
|
||||
if ( len < ll_header_len ) {
|
||||
DBGC ( snpdev, "SNPDEV %p invalid packet length %ld\n",
|
||||
DBGC ( snpdev, "SNPDEV %p invalid packet length %d\n",
|
||||
snpdev, len );
|
||||
efirc = EFI_BUFFER_TOO_SMALL;
|
||||
goto err_sanity;
|
||||
@@ -541,7 +541,7 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
/* Allocate buffer */
|
||||
iobuf = alloc_iob ( len );
|
||||
if ( ! iobuf ) {
|
||||
DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte "
|
||||
DBGC ( snpdev, "SNPDEV %p TX could not allocate %d-byte "
|
||||
"buffer\n", snpdev, len );
|
||||
efirc = EFI_DEVICE_ERROR;
|
||||
goto err_alloc_iob;
|
||||
@@ -610,7 +610,7 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
|
||||
int rc;
|
||||
EFI_STATUS efirc;
|
||||
|
||||
DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%lx)", snpdev, data, *len );
|
||||
DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%x)", snpdev, data, *len );
|
||||
|
||||
/* Poll the network device */
|
||||
efi_snp_poll ( snpdev );
|
||||
@@ -737,10 +737,10 @@ efi_snp_netdev ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device ) {
|
||||
if ( ( efirc = u.pci->GetLocation ( u.pci, &pci_segment, &pci_bus,
|
||||
&pci_dev, &pci_fn ) ) != 0 ) {
|
||||
DBGC ( driver, "SNPDRV %p device %p could not get PCI "
|
||||
"location: %lx\n", driver, device, efirc );
|
||||
"location: %x\n", driver, device, efirc );
|
||||
goto out_no_pci_location;
|
||||
}
|
||||
DBGCP ( driver, "SNPDRV %p device %p is PCI %04lx:%02lx:%02lx.%lx\n",
|
||||
DBGCP ( driver, "SNPDRV %p device %p is PCI %04x:%02x:%02x.%x\n",
|
||||
driver, device, pci_segment, pci_bus, pci_dev, pci_fn );
|
||||
|
||||
/* Look up corresponding network device */
|
||||
@@ -786,7 +786,7 @@ efi_snp_snpdev ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device ) {
|
||||
device,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL))!=0){
|
||||
DBGC ( driver, "SNPDRV %p device %p could not locate SNP: "
|
||||
"%lx\n", driver, device, efirc );
|
||||
"%x\n", driver, device, efirc );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
||||
if ( ( efirc = bs->CreateEvent ( EVT_NOTIFY_WAIT, TPL_NOTIFY,
|
||||
efi_snp_wait_for_packet, snpdev,
|
||||
&snpdev->snp.WaitForPacket ) ) != 0 ){
|
||||
DBGC ( snpdev, "SNPDEV %p could not create event: %lx\n",
|
||||
DBGC ( snpdev, "SNPDEV %p could not create event: %x\n",
|
||||
snpdev, efirc );
|
||||
goto err_create_event;
|
||||
}
|
||||
@@ -882,7 +882,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
||||
if ( ( efirc = bs->InstallProtocolInterface ( &device,
|
||||
&efi_simple_network_protocol_guid,
|
||||
EFI_NATIVE_INTERFACE, &snpdev->snp ) ) != 0 ) {
|
||||
DBGC ( snpdev, "SNPDEV %p could not install protocol: %lx\n",
|
||||
DBGC ( snpdev, "SNPDEV %p could not install protocol: %x\n",
|
||||
snpdev, efirc );
|
||||
goto err_install_protocol_interface;
|
||||
}
|
||||
@@ -922,7 +922,7 @@ efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver,
|
||||
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
||||
struct efi_snp_device *snpdev;
|
||||
|
||||
DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%ld %p)\n",
|
||||
DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%d %p)\n",
|
||||
driver, device, num_children, children );
|
||||
|
||||
/* Locate SNP device */
|
||||
@@ -970,7 +970,7 @@ int efi_snp_install ( void ) {
|
||||
EFI_NATIVE_INTERFACE,
|
||||
driver ) ) != 0 ) {
|
||||
DBGC ( driver, "SNPDRV %p could not install driver binding: "
|
||||
"%lx\n", driver, efirc );
|
||||
"%x\n", driver, efirc );
|
||||
return EFIRC_TO_RC ( efirc );
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ static void efi_udelay ( unsigned long usecs ) {
|
||||
EFI_STATUS efirc;
|
||||
|
||||
if ( ( efirc = bs->Stall ( usecs ) ) != 0 ) {
|
||||
DBG ( "EFI could not delay for %ldus: %lx\n",
|
||||
DBG ( "EFI could not delay for %ldus: %x\n",
|
||||
usecs, efirc );
|
||||
/* Probably screwed */
|
||||
}
|
||||
@@ -71,7 +71,7 @@ static unsigned long efi_currticks ( void ) {
|
||||
/* Read CPU timer 0 (TSC) */
|
||||
if ( ( efirc = cpu_arch->GetTimerValue ( cpu_arch, 0, &time,
|
||||
NULL ) ) != 0 ) {
|
||||
DBG ( "EFI could not read CPU timer: %lx\n", efirc );
|
||||
DBG ( "EFI could not read CPU timer: %x\n", efirc );
|
||||
/* Probably screwed */
|
||||
return -1UL;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) {
|
||||
EfiBootServicesData,
|
||||
new_pages,
|
||||
&phys_addr ) ) != 0 ) {
|
||||
DBG ( "EFI could not allocate %d pages: %lx\n",
|
||||
DBG ( "EFI could not allocate %d pages: %x\n",
|
||||
new_pages, efirc );
|
||||
return UNULL;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) {
|
||||
old_pages = ( EFI_SIZE_TO_PAGES ( old_size ) + 1 );
|
||||
phys_addr = user_to_phys ( old_ptr, -EFI_PAGE_SIZE );
|
||||
if ( ( efirc = bs->FreePages ( phys_addr, old_pages ) ) != 0 ){
|
||||
DBG ( "EFI could not free %d pages at %llx: %lx\n",
|
||||
DBG ( "EFI could not free %d pages at %llx: %x\n",
|
||||
old_pages, phys_addr, efirc );
|
||||
/* Not fatal; we have leaked memory but successfully
|
||||
* allocated (if asked to do so).
|
||||
|
||||
Reference in New Issue
Block a user