DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
undinet_function_name ( function ), strerror ( rc ) );
DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
- "%#02x, entry point at %04x:%04x\n", undinic,
+ "%#02zx, entry point at %04x:%04x\n", undinic,
rm_params.segment, rm_params.offset, params_len,
undinet_entry_point.segment,
undinet_entry_point.offset );
undirom->data_size = undi_rom_id.DataSize;
DBGC ( undirom, "UNDIROM %p has UNDI loader at %04x:%04x "
- "(code %04x data %04x)\n", undirom,
+ "(code %04zx data %04zx)\n", undirom,
undirom->loader_entry.segment, undirom->loader_entry.offset,
undirom->code_size, undirom->data_size );
return 0;
strings_offset = ( offset + header.length );
if ( strings_offset > smbios->length ) {
DBG ( "SMBIOS structure at offset %zx with length "
- "%zx extends beyond SMBIOS\n", offset,
+ "%x extends beyond SMBIOS\n", offset,
header.length );
return -ENOENT;
}
strings->length = ( terminator_offset - strings_offset );
DBG ( "SMBIOS structure at offset %zx has type %d, "
- "length %zx, strings length %zx\n",
+ "length %x, strings length %zx\n",
offset, header.type, header.length, strings->length );
/* If this is the structure we want, return */
shutdown();
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
- "(stack %04x:%04x)\n", image,
+ "(stack %04x:%04zx)\n", image,
( exec_ctx.rm_kernel_seg + 0x20 ),
exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
if ( offset != image->len ) {
- DBGC ( image, "NBI %p length wrong (file %d, metadata %d)\n",
+ DBGC ( image, "NBI %p length wrong (file %zd, metadata %zd)\n",
image, image->len, offset );
return -ENOEXEC;
}
* NOTE: It would be possible to build a smaller version of the
* decompression code for -DKEEP_IT_REAL by using
* #define REG(x) x
- * #define MOVSB movsb
* to use 16-bit registers where possible. This would impose limits
* that the compressed data size must be in the range [1,65533-%si]
* and the uncompressed data size must be in the range [1,65536-%di]
*/
#define REG(x) e ## x
-#define MOVSB addr32 movsb
+#define ADDR32 addr32
.code16
.globl decompress16
*/
#define REG(x) e ## x
+#define ADDR32
.code32
.globl decompress
jmp dcl1_n2b
decompr_literals_n2b:
- MOVSB
+ ADDR32 movsb
decompr_loop_n2b:
addl %ebx, %ebx
jnz dcl2_n2b
sub $3, %xAX
jb decompr_ebpeax_n2b /* if (m_off == 2) goto decompr_ebpeax_n2b ? */
shl $8, %xAX
- movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
+ ADDR32 movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
inc %xSI
xor $-1, %xAX
jz decompr_end_n2b /* if (m_off == 0xffffffff) goto decomp_end_n2b */
cmp $-0xd00, %xBP
adc $1, %xCX /* m_len = m_len + 1 + (last_m_off > 0xd00) */
push %xSI
- lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
+ ADDR32 lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
rep
- es MOVSB /* dst[olen++] = *m_pos++ while(m_len > 0) */
+ es ADDR32 movsb /* dst[olen++] = *m_pos++ while(m_len > 0) */
pop %xSI
jmp decompr_loop_n2b
addl %ebx, %ebx
jnz 1f
getbit32:
- movl (%xSI), %ebx
+ ADDR32 movl (%xSI), %ebx
sub $-4, %xSI /* sets carry flag */
adcl %ebx, %ebx
1:
movzwl %sp, %edx
movl %ebp, %eax
shll $4, %eax
- leal (%eax,%edx), %esi
+ addr32 leal (%eax,%edx), %esi
subl _virt_offset, %esi
/* Switch to protected mode */
len_len = 1;
}
if ( cursor->len < len_len ) {
- DBGC ( cursor, "ASN1 %p bad length field length %d (max %d)\n",
- cursor, len_len, cursor->len );
+ DBGC ( cursor, "ASN1 %p bad length field length %d (max "
+ "%zd)\n", cursor, len_len, cursor->len );
goto notfound;
}
cursor->len--;
}
if ( cursor->len < len ) {
- DBGC ( cursor, "ASN1 %p bad length %d (max %d)\n",
+ DBGC ( cursor, "ASN1 %p bad length %d (max %zd)\n",
cursor, len, cursor->len );
goto notfound;
}
state_len = ( digest->ctxsize + digest->digestsize );
state = malloc ( state_len );
if ( ! state ) {
- DBG ( "CHAP %p could not allocate %d bytes for state\n",
+ DBG ( "CHAP %p could not allocate %zd bytes for state\n",
chap, state_len );
return -ENOMEM;
}
device->munge_address );
int rc;
- DBG ( "SPI %p reading %d bytes from %#04x\n", device, len, address );
+ DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, command, address,
NULL, data, len ) ) != 0 ) {
DBG ( "SPI %p failed to read data from device\n", device );
device->munge_address );
int rc;
- DBG ( "SPI %p writing %d bytes to %#04x\n", device, len, address );
+ DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
NULL, NULL, 0 ) ) != 0 ) {
assert ( bus->mode == SPI_MODE_THREEWIRE );
- DBG ( "3wire %p reading %d bytes at %04x\n", device, len, address );
+ DBG ( "3wire %p reading %zd bytes at %04x\n", device, len, address );
return bus->rw ( bus, device, THREEWIRE_READ, address,
NULL, data, len );
assert ( bus->mode == SPI_MODE_THREEWIRE );
- DBG ( "3wire %p writing %d bytes at %04x\n", device, len, address );
+ DBG ( "3wire %p writing %zd bytes at %04x\n", device, len, address );
/* Enable device for writing */
if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,
copy_from_real ( &tbd, undi_transmit->TBD.segment,
undi_transmit->TBD.offset, sizeof ( tbd ) );
len = tbd.ImmedLength;
- DBG ( " %zd", tbd.ImmedLength );
+ DBG ( " %d", tbd.ImmedLength );
for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
datablk = &tbd.DataBlock[i];
len += datablk->TDDataLen;
- DBG ( "+%zd", datablk->TDDataLen );
+ DBG ( "+%d", datablk->TDDataLen );
}
/* Allocate and fill I/O buffer */
char *end = buf + len;
char *name;
char *value;
- int rc;
+ int rc = 0;
/* Sanity check */
if ( len < sizeof ( *oack ) ) {
DBGC ( tftp, "TFTP %p received underlength OACK packet "
- "length %d\n", tftp, len );
+ "length %zd\n", tftp, len );
rc = -EINVAL;
goto done;
}
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *data ) ) {
DBGC ( tftp, "TFTP %p received underlength DATA packet "
- "length %d\n", tftp, iob_len ( iobuf ) );
+ "length %zd\n", tftp, iob_len ( iobuf ) );
rc = -EINVAL;
goto done;
}
data_len = iob_len ( iobuf );
if ( data_len > tftp->blksize ) {
DBGC ( tftp, "TFTP %p received overlength DATA packet "
- "length %d\n", tftp, data_len );
+ "length %zd\n", tftp, data_len );
rc = -EINVAL;
goto done;
}
/* Sanity check */
if ( len < sizeof ( *error ) ) {
DBGC ( tftp, "TFTP %p received underlength ERROR packet "
- "length %d\n", tftp, len );
+ "length %zd\n", tftp, len );
return -EINVAL;
}
/* Sanity checks */
if ( len < sizeof ( *common ) ) {
- DBGC ( tftp, "TFTP %p received underlength packet length %d\n",
- tftp, len );
+ DBGC ( tftp, "TFTP %p received underlength packet length "
+ "%zd\n", tftp, len );
goto done;
}
if ( ! meta ) {