This patch converts __FUNCTION__ to __func__, since __func__ is standard.

Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@1131 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Myles Watson 2009-02-12 21:15:34 +00:00
parent 52e3eecb8a
commit 9d6d811dd1
20 changed files with 186 additions and 186 deletions

View file

@ -411,7 +411,7 @@ void x86_setup_var_mtrrs(unsigned address_bits)
} }
printk(BIOS_SPEW, "call enable_var_mtrr()\n"); printk(BIOS_SPEW, "call enable_var_mtrr()\n");
enable_var_mtrr(); enable_var_mtrr();
printk(BIOS_SPEW, "Leave %s\n", __FUNCTION__); printk(BIOS_SPEW, "Leave %s\n", __func__);
post_code(0x6A); post_code(0x6A);
} }

View file

@ -40,7 +40,7 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
sum += addr[i]; sum += addr[i];
printk(BIOS_DEBUG, "%s() - irq_routing_table located at: 0x%p\n", printk(BIOS_DEBUG, "%s() - irq_routing_table located at: 0x%p\n",
__FUNCTION__, addr); __func__, addr);
sum = rt->checksum - sum; sum = rt->checksum - sum;
@ -48,7 +48,7 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
if (sum != rt->checksum) { if (sum != rt->checksum) {
printk(BIOS_WARNING, "%s:%6d:%s() - " printk(BIOS_WARNING, "%s:%6d:%s() - "
"checksum is: 0x%02x but should be: 0x%02x\n", "checksum is: 0x%02x but should be: 0x%02x\n",
__FILE__, __LINE__, __FUNCTION__, rt->checksum, sum); __FILE__, __LINE__, __func__, rt->checksum, sum);
rt->checksum = sum; rt->checksum = sum;
} }
@ -56,7 +56,7 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
rt->size % 16 ) { rt->size % 16 ) {
printk(BIOS_WARNING, "%s:%6d:%s() - " printk(BIOS_WARNING, "%s:%6d:%s() - "
"Interrupt Routing Table not valid\n", "Interrupt Routing Table not valid\n",
__FILE__, __LINE__, __FUNCTION__); __FILE__, __LINE__, __func__);
return; return;
} }
@ -67,7 +67,7 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
if (sum) { if (sum) {
printk(BIOS_WARNING, "%s:%6d:%s() - " printk(BIOS_WARNING, "%s:%6d:%s() - "
"checksum error in irq routing table\n", "checksum error in irq routing table\n",
__FILE__, __LINE__, __FUNCTION__); __FILE__, __LINE__, __func__);
} }
printk(BIOS_INFO, "done.\n"); printk(BIOS_INFO, "done.\n");

View file

@ -72,7 +72,7 @@ static struct device *new_device(void)
{ {
devcnt++; devcnt++;
printk(BIOS_SPEW, "%s: devcnt %d\n", __FUNCTION__, devcnt); printk(BIOS_SPEW, "%s: devcnt %d\n", __func__, devcnt);
/* Should we really die here? */ /* Should we really die here? */
if (devcnt >= MAX_DEVICES) { if (devcnt >= MAX_DEVICES) {
die("Too many devices. Increase MAX_DEVICES\n"); die("Too many devices. Increase MAX_DEVICES\n");
@ -946,13 +946,13 @@ void dev_phase5(struct device *dev)
} }
if (!dev->ops) { if (!dev->ops) {
printk(BIOS_WARNING, "%s: %s(%s) missing ops\n", printk(BIOS_WARNING, "%s: %s(%s) missing ops\n",
__FUNCTION__, dev->dtsname, dev_path(dev)); __func__, dev->dtsname, dev_path(dev));
return; return;
} }
if (!dev->ops->phase5_enable_resources) { if (!dev->ops->phase5_enable_resources) {
printk(BIOS_WARNING, printk(BIOS_WARNING,
"%s: %s(%s) ops are missing phase5_enable_resources\n", "%s: %s(%s) ops are missing phase5_enable_resources\n",
__FUNCTION__, dev->dtsname, dev_path(dev)); __func__, dev->dtsname, dev_path(dev));
return; return;
} }
@ -1055,19 +1055,19 @@ unsigned int dev_phase3_scan(struct device *busdevice, unsigned int max)
if (!busdevice || !busdevice->enabled || if (!busdevice || !busdevice->enabled ||
!busdevice->ops || !busdevice->ops->phase3_scan) { !busdevice->ops || !busdevice->ops->phase3_scan) {
printk(BIOS_INFO, "%s: busdevice %s: enabled %d ops %s\n", printk(BIOS_INFO, "%s: busdevice %s: enabled %d ops %s\n",
__FUNCTION__, busdevice ? busdevice->dtsname : "NULL", __func__, busdevice ? busdevice->dtsname : "NULL",
busdevice ? busdevice->enabled : 0, busdevice ? busdevice->enabled : 0,
busdevice ? (busdevice->ops? busdevice ? (busdevice->ops?
"NOT NULL" : "NULL") : "N/A"); "NOT NULL" : "NULL") : "N/A");
printk(BIOS_INFO, "%s: can not scan from here, returning %d\n", printk(BIOS_INFO, "%s: can not scan from here, returning %d\n",
__FUNCTION__, max); __func__, max);
return max; return max;
} }
do_phase3 = 1; do_phase3 = 1;
while (do_phase3) { while (do_phase3) {
int link; int link;
printk(BIOS_INFO, "%s: scanning %s(%s)\n", __FUNCTION__, printk(BIOS_INFO, "%s: scanning %s(%s)\n", __func__,
busdevice->dtsname, dev_path(busdevice)); busdevice->dtsname, dev_path(busdevice));
#warning do we call phase3_enable here. #warning do we call phase3_enable here.
new_max = busdevice->ops->phase3_scan(busdevice, max); new_max = busdevice->ops->phase3_scan(busdevice, max);
@ -1084,7 +1084,7 @@ unsigned int dev_phase3_scan(struct device *busdevice, unsigned int max)
} }
} }
post_code(POST_STAGE2_PHASE3_SCAN_EXIT); post_code(POST_STAGE2_PHASE3_SCAN_EXIT);
printk(BIOS_INFO, "%s: returning %d\n", __FUNCTION__, max); printk(BIOS_INFO, "%s: returning %d\n", __func__, max);
return new_max; return new_max;
} }

View file

@ -125,7 +125,7 @@ struct device *dev_find_slot_on_smbus(unsigned int bus, unsigned int addr)
*/ */
struct device *dev_find_device(struct device_id *devid, struct device *from) struct device *dev_find_device(struct device_id *devid, struct device *from)
{ {
printk(BIOS_SPEW, "%s: find %s\n", __FUNCTION__, dev_id_string(devid)); printk(BIOS_SPEW, "%s: find %s\n", __func__, dev_id_string(devid));
if (!from) if (!from)
from = all_devices; from = all_devices;

View file

@ -940,7 +940,7 @@ static struct device *pci_get_dev(struct device **list, unsigned int devfn)
if ((*list)->path.type != DEVICE_PATH_PCI) { if ((*list)->path.type != DEVICE_PATH_PCI) {
printk(BIOS_NOTICE, printk(BIOS_NOTICE,
"%s: child %s(%s) not a pci device: it's type %d\n", "%s: child %s(%s) not a pci device: it's type %d\n",
__FUNCTION__, (*list)->dtsname, dev_path(*list), __func__, (*list)->dtsname, dev_path(*list),
(*list)->path.type); (*list)->path.type);
continue; continue;
} }

View file

@ -86,7 +86,7 @@ static int load_elf_segments(struct lb_memory *mem,unsigned char *header, int he
ehdr = (Elf_ehdr *)header; ehdr = (Elf_ehdr *)header;
phdr = (Elf_phdr *)(&header[ehdr->e_phoff]); phdr = (Elf_phdr *)(&header[ehdr->e_phoff]);
printk(BIOS_DEBUG, "%s: header %p #headers %d\n", __FUNCTION__, header, headers); printk(BIOS_DEBUG, "%s: header %p #headers %d\n", __func__, header, headers);
int i; int i;
int size; int size;
for(i = 0; i < headers; i++) { for(i = 0; i < headers; i++) {

View file

@ -81,7 +81,7 @@ u64 get_systop(struct northbridge_amd_geodelx_pci_config *nb_dm)
*/ */
static void geodelx_northbridge_init(struct device *dev) static void geodelx_northbridge_init(struct device *dev)
{ {
printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __func__);
enable_shadow(dev); enable_shadow(dev);
} }
@ -201,7 +201,7 @@ static void geodelx_pci_domain_phase2(struct device *dev)
{ {
void do_vsmbios(void); void do_vsmbios(void);
printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __func__);
/* northbridge_init_early(); */ /* northbridge_init_early(); */
chipsetinit(); chipsetinit();
@ -237,8 +237,8 @@ static void geodelx_mc_phase2(struct device *dev)
*/ */
static void cpu_bus_init(struct device *dev) static void cpu_bus_init(struct device *dev)
{ {
printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __func__);
printk(BIOS_SPEW, ">> Exiting northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Exiting northbridge.c: %s\n", __func__);
} }
static void cpu_bus_noop(struct device *dev) static void cpu_bus_noop(struct device *dev)

View file

@ -66,7 +66,7 @@ static void writeglmsr(const struct gliutable *gl)
msr.hi = gl->hi; msr.hi = gl->hi;
wrmsr(gl->desc_name, msr); wrmsr(gl->desc_name, msr);
printk(BIOS_SPEW, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", printk(BIOS_SPEW, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n",
__FUNCTION__, gl->desc_name, msr.hi, msr.lo); __func__, gl->desc_name, msr.hi, msr.lo);
} }
/** /**
@ -143,7 +143,7 @@ static void sysmem_init(const struct gliutable *gl)
*/ */
sizembytes = sizeram(); sizembytes = sizeram();
printk(BIOS_DEBUG, "%s: enable for %dMBytes\n", printk(BIOS_DEBUG, "%s: enable for %dMBytes\n",
__FUNCTION__, sizembytes); __func__, sizembytes);
sizebytes = sizembytes << 20; sizebytes = sizembytes << 20;
sizebytes -= ((SMM_SIZE * 1024) + 1); sizebytes -= ((SMM_SIZE * 1024) + 1);
@ -160,7 +160,7 @@ static void sysmem_init(const struct gliutable *gl)
msr.lo = sizebytes; msr.lo = sizebytes;
wrmsr(gl->desc_name, msr); wrmsr(gl->desc_name, msr);
printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __FUNCTION__, printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __func__,
gl->desc_name, msr.hi, msr.lo); gl->desc_name, msr.hi, msr.lo);
} }
@ -177,12 +177,12 @@ static void SMMGL0Init(const struct gliutable *gl)
sizebytes -= (SMM_SIZE * 1024); sizebytes -= (SMM_SIZE * 1024);
printk(BIOS_DEBUG, "%s: %d bytes\n", __FUNCTION__, sizebytes); printk(BIOS_DEBUG, "%s: %d bytes\n", __func__, sizebytes);
/* Calculate the "two's complement" offset. */ /* Calculate the "two's complement" offset. */
offset = sizebytes - SMM_OFFSET; offset = sizebytes - SMM_OFFSET;
offset = (offset >> 12) & 0x000fffff; offset = (offset >> 12) & 0x000fffff;
printk(BIOS_DEBUG, "%s: offset is 0x%08x\n", __FUNCTION__, SMM_OFFSET); printk(BIOS_DEBUG, "%s: offset is 0x%08x\n", __func__, SMM_OFFSET);
msr.hi = offset << 8 | gl->hi; msr.hi = offset << 8 | gl->hi;
msr.hi |= SMM_OFFSET >> 24; msr.hi |= SMM_OFFSET >> 24;
@ -191,7 +191,7 @@ static void SMMGL0Init(const struct gliutable *gl)
msr.lo |= ((~(SMM_SIZE * 1024) + 1) >> 12) & 0xfffff; msr.lo |= ((~(SMM_SIZE * 1024) + 1) >> 12) & 0xfffff;
wrmsr(gl->desc_name, msr); wrmsr(gl->desc_name, msr);
printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __FUNCTION__, printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __func__,
gl->desc_name, msr.hi, msr.lo); gl->desc_name, msr.hi, msr.lo);
} }
@ -204,7 +204,7 @@ static void SMMGL1Init(const struct gliutable *gl)
{ {
struct msr msr; struct msr msr;
printk(BIOS_DEBUG, "%s:\n", __FUNCTION__); printk(BIOS_DEBUG, "%s:\n", __func__);
msr.hi = gl->hi; msr.hi = gl->hi;
/* I don't think this is needed. */ /* I don't think this is needed. */
@ -214,7 +214,7 @@ static void SMMGL1Init(const struct gliutable *gl)
msr.lo |= ((~(SMM_SIZE * 1024) + 1) >> 12) & 0xfffff; msr.lo |= ((~(SMM_SIZE * 1024) + 1) >> 12) & 0xfffff;
wrmsr(gl->desc_name, msr); wrmsr(gl->desc_name, msr);
printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __FUNCTION__, printk(BIOS_DEBUG, "%s: MSR 0x%08lx, val 0x%08x:0x%08x\n", __func__,
gl->desc_name, msr.hi, msr.lo); gl->desc_name, msr.hi, msr.lo);
} }
@ -742,7 +742,7 @@ void northbridge_init_early(void)
{ {
int i; int i;
printk(BIOS_DEBUG, "Enter %s\n", __FUNCTION__); printk(BIOS_DEBUG, "Enter %s\n", __func__);
for (i = 0; gliutables[i]; i++) for (i = 0; gliutables[i]; i++)
GLIUInit(gliutables[i]); GLIUInit(gliutables[i]);
@ -760,7 +760,7 @@ void northbridge_init_early(void)
__asm__ __volatile__("FINIT\n"); /* TODO: Create finit() function? */ __asm__ __volatile__("FINIT\n"); /* TODO: Create finit() function? */
printk(BIOS_DEBUG, "Exit %s\n", __FUNCTION__); printk(BIOS_DEBUG, "Exit %s\n", __func__);
} }
void geode_pre_payload(void) void geode_pre_payload(void)

View file

@ -29,8 +29,8 @@
static void cpu_bus_init(struct device *dev) static void cpu_bus_init(struct device *dev)
{ {
#warning "cpu_bus_init() empty, what should it do?" #warning "cpu_bus_init() empty, what should it do?"
printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Entering northbridge.c: %s\n", __func__);
printk(BIOS_SPEW, ">> Exiting northbridge.c: %s\n", __FUNCTION__); printk(BIOS_SPEW, ">> Exiting northbridge.c: %s\n", __func__);
} }
static void cpu_bus_noop(struct device *dev) static void cpu_bus_noop(struct device *dev)

View file

@ -561,7 +561,7 @@ void chipsetinit(void)
PCI_DEVICE_ID_AMD_CS5536_ISA, 0); PCI_DEVICE_ID_AMD_CS5536_ISA, 0);
if (!dev) { if (!dev) {
printk(BIOS_ERR, "%s: Could not find the south bridge!\n", printk(BIOS_ERR, "%s: Could not find the south bridge!\n",
__FUNCTION__); __func__);
return; return;
} }
sb = (struct southbridge_amd_cs5536_dts_config *)dev->device_configuration; sb = (struct southbridge_amd_cs5536_dts_config *)dev->device_configuration;
@ -663,7 +663,7 @@ static void southbridge_init(struct device *dev)
* unsigned short gpiobase = MDD_GPIO; * unsigned short gpiobase = MDD_GPIO;
*/ */
printk(BIOS_ERR, "cs5536: %s\n", __FUNCTION__); printk(BIOS_ERR, "cs5536: %s\n", __func__);
setup_i8259(); setup_i8259();
lpc_init(sb); lpc_init(sb);
@ -689,7 +689,7 @@ static void southbridge_init(struct device *dev)
cs5536_setup_power_button(sb); cs5536_setup_power_button(sb);
printk(BIOS_SPEW, "cs5536: %s() Exit\n", __FUNCTION__); printk(BIOS_SPEW, "cs5536: %s() Exit\n", __func__);
} }
/** /**
@ -719,10 +719,10 @@ static void cs5536_read_resources(struct device *dev)
*/ */
static void cs5536_pci_dev_enable_resources(struct device *dev) static void cs5536_pci_dev_enable_resources(struct device *dev)
{ {
printk(BIOS_SPEW, "cs5536: %s()\n", __FUNCTION__); printk(BIOS_SPEW, "cs5536: %s()\n", __func__);
pci_dev_enable_resources(dev); pci_dev_enable_resources(dev);
enable_childrens_resources(dev); enable_childrens_resources(dev);
printk(BIOS_SPEW, "cs5536: %s() Exit\n", __FUNCTION__); printk(BIOS_SPEW, "cs5536: %s() Exit\n", __func__);
} }
struct device_operations cs5536_ops = { struct device_operations cs5536_ops = {

View file

@ -43,7 +43,7 @@ unsigned long write_pirq_routing_table(unsigned long addr)
/* Set up chipset IRQ steering. */ /* Set up chipset IRQ steering. */
pciAddr = 0x80000000 | (CHIPSET_DEV_NUM << 11) | 0x5C; pciAddr = 0x80000000 | (CHIPSET_DEV_NUM << 11) | 0x5C;
chipset_irq_map = (PIRQD << 12 | PIRQC << 8 | PIRQB << 4 | PIRQA); chipset_irq_map = (PIRQD << 12 | PIRQC << 8 | PIRQB << 4 | PIRQA);
printk(BIOS_DEBUG, "%s(%08X, %04X)\n", __FUNCTION__, pciAddr, printk(BIOS_DEBUG, "%s(%08X, %04X)\n", __func__, pciAddr,
chipset_irq_map); chipset_irq_map);
outl(pciAddr & ~3, 0xCF8); outl(pciAddr & ~3, 0xCF8);
outl(chipset_irq_map, 0xCFC); outl(chipset_irq_map, 0xCFC);

View file

@ -86,7 +86,7 @@ void do_no_uncompress(char *dst, int dst_len, char *src, int src_len)
else else
{ {
fprintf(stderr, "%s: src_len(%d)!=dst_len(%d)\n", fprintf(stderr, "%s: src_len(%d)!=dst_len(%d)\n",
__FUNCTION__, src_len, dst_len); __func__, src_len, dst_len);
exit(1); exit(1);
} }
} }
@ -208,7 +208,7 @@ static int handle_directory(const char *name, const char *pathname,
if (len > MAX_PATHLEN) { if (len > MAX_PATHLEN) {
fprintf(stderr, fprintf(stderr,
"%s: %s+%s exceeds MAX_PATHLEN.\n", "%s: %s+%s exceeds MAX_PATHLEN.\n",
__FUNCTION__, name, __func__, name,
namelist[n]->d_name); namelist[n]->d_name);
return -1; return -1;
} }
@ -227,7 +227,7 @@ static int handle_directory(const char *name, const char *pathname,
if (len > MAX_PATHLEN) { if (len > MAX_PATHLEN) {
fprintf(stderr, fprintf(stderr,
"%s: %s+%s exceeds MAX_PATHLEN.\n", "%s: %s+%s exceeds MAX_PATHLEN.\n",
__FUNCTION__, pathname, __func__, pathname,
namelist[n]->d_name); namelist[n]->d_name);
return -1; return -1;
} }
@ -264,7 +264,7 @@ int add_files(const char *filename, const char * pathname,
char *c; char *c;
if (verbose()) if (verbose())
printf("%s: %s:%s\n", __FUNCTION__, filename, pathname); printf("%s: %s:%s\n", __func__, filename, pathname);
if (stat(filename, &filestat) == -1) { if (stat(filename, &filestat) == -1) {
fprintf(stderr, "Error getting file attributes of %s\n", filename); fprintf(stderr, "Error getting file attributes of %s\n", filename);

View file

@ -126,7 +126,7 @@ int output_elf_segments(struct lar *lar, char *name, char *filebuf,
shdr = (Elf32_Shdr *)&(header[ehdr->e_shoff]); shdr = (Elf32_Shdr *)&(header[ehdr->e_shoff]);
if (verbose()) if (verbose())
fprintf(stderr, "%s: header %p #headers %d\n", __FUNCTION__, ehdr, headers); fprintf(stderr, "%s: header %p #headers %d\n", __func__, ehdr, headers);
entry = ehdr->e_entry; entry = ehdr->e_entry;
/* bss segments are special. They are in the section headers, /* bss segments are special. They are in the section headers,

View file

@ -19,7 +19,7 @@ u32 debug_flags = 0;
void void
dump(u8 * addr, u32 len) dump(u8 * addr, u32 len)
{ {
printf("\n%s(%p, %x):\n", __FUNCTION__, addr, len); printf("\n%s(%p, %x):\n", __func__, addr, len);
while (len) { while (len) {
unsigned int tmpCnt = len; unsigned int tmpCnt = len;
unsigned char x; unsigned char x;

View file

@ -73,7 +73,7 @@ biosemu_dev_get_addr_info(void)
taa_index++; taa_index++;
/* legacy ranges if its a VGA card... */ /* legacy ranges if its a VGA card... */
if ((bios_device.dev->class & 0xFF0000) == 0x030000) { if ((bios_device.dev->class & 0xFF0000) == 0x030000) {
DEBUG_PRINTF("%s: VGA device found, adding legacy resources... \n", __FUNCTION__); DEBUG_PRINTF("%s: VGA device found, adding legacy resources... \n", __func__);
/* I/O 0x3B0-0x3BB */ /* I/O 0x3B0-0x3BB */
translate_address_array[taa_index].info = IORESOURCE_FIXED | IORESOURCE_IO; translate_address_array[taa_index].info = IORESOURCE_FIXED | IORESOURCE_IO;
translate_address_array[taa_index].bus = bus; translate_address_array[taa_index].bus = bus;
@ -237,7 +237,7 @@ biosemu_dev_find_vmem_addr(void)
bios_device.vmem_size = ta.size; bios_device.vmem_size = ta.size;
DEBUG_PRINTF DEBUG_PRINTF
("%s: Found prefetchable Virtual Legacy Memory BAR: %llx, size: %llx\n", ("%s: Found prefetchable Virtual Legacy Memory BAR: %llx, size: %llx\n",
__FUNCTION__, bios_device.vmem_addr, __func__, bios_device.vmem_addr,
bios_device.vmem_size); bios_device.vmem_size);
} else if (tai_np != -1) { } else if (tai_np != -1) {
ta = translate_address_array[tai_np]; ta = translate_address_array[tai_np];
@ -245,7 +245,7 @@ biosemu_dev_find_vmem_addr(void)
bios_device.vmem_size = ta.size; bios_device.vmem_size = ta.size;
DEBUG_PRINTF DEBUG_PRINTF
("%s: Found non-prefetchable Virtual Legacy Memory BAR: %llx, size: %llx", ("%s: Found non-prefetchable Virtual Legacy Memory BAR: %llx, size: %llx",
__FUNCTION__, bios_device.vmem_addr, __func__, bios_device.vmem_addr,
bios_device.vmem_size); bios_device.vmem_size);
} }
// disable vmem // disable vmem
@ -388,7 +388,7 @@ biosemu_dev_init(struct device * device)
{ {
u8 rval = 0; u8 rval = 0;
//init bios_device struct //init bios_device struct
DEBUG_PRINTF("%s(%s)\n", __FUNCTION__, device->dtsname); DEBUG_PRINTF("%s(%s)\n", __func__, device->dtsname);
memset(&bios_device, 0, sizeof(bios_device)); memset(&bios_device, 0, sizeof(bios_device));
#ifndef CONFIG_PCI_OPTION_ROM_RUN_YABEL #ifndef CONFIG_PCI_OPTION_ROM_RUN_YABEL

View file

@ -31,7 +31,7 @@ void
setupInt(int intNum) setupInt(int intNum)
{ {
DEBUG_PRINTF_INTR("%s(%x): executing interrupt handler @%08x\n", DEBUG_PRINTF_INTR("%s(%x): executing interrupt handler @%08x\n",
__FUNCTION__, intNum, my_rdl(intNum * 4)); __func__, intNum, my_rdl(intNum * 4));
// push current R_FLG... will be popped by IRET // push current R_FLG... will be popped by IRET
push_word((u16) M.x86.R_FLG); push_word((u16) M.x86.R_FLG);
CLEAR_FLAG(F_IF); CLEAR_FLAG(F_IF);
@ -51,7 +51,7 @@ handleInt10(void)
{ {
// the data for INT10 is stored in BDA (0000:0400h) offset 49h-66h // the data for INT10 is stored in BDA (0000:0400h) offset 49h-66h
// function number in AH // function number in AH
//DEBUG_PRINTF_CS_IP("%s:\n", __FUNCTION__); //DEBUG_PRINTF_CS_IP("%s:\n", __func__);
//x86emu_dump_xregs(); //x86emu_dump_xregs();
//if ((M.x86.R_IP == 0x32c2) && (M.x86.R_SI == 0x1ce2)){ //if ((M.x86.R_IP == 0x32c2) && (M.x86.R_SI == 0x1ce2)){
//X86EMU_trace_on(); //X86EMU_trace_on();
@ -156,7 +156,7 @@ handleInt10(void)
break; break;
default: default:
printf("%s(): unknown function (%x) for int10 handler.\n", printf("%s(): unknown function (%x) for int10 handler.\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n",
M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX,
M.x86.R_DX); M.x86.R_DX);
@ -220,7 +220,7 @@ translate_keycode(u64 * keycode)
break; break;
default: default:
printf("%s(): unknown multibyte keycode: %llx\n", printf("%s(): unknown multibyte keycode: %llx\n",
__FUNCTION__, *keycode); __func__, *keycode);
break; break;
} }
} }
@ -244,7 +244,7 @@ handleInt16(void)
s8 c; s8 c;
// function number in AH // function number in AH
DEBUG_PRINTF_INTR("%s(): Keyboard Interrupt: function: %x.\n", DEBUG_PRINTF_INTR("%s(): Keyboard Interrupt: function: %x.\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", M.x86.R_AX, DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", M.x86.R_AX,
M.x86.R_BX, M.x86.R_CX, M.x86.R_DX); M.x86.R_BX, M.x86.R_CX, M.x86.R_DX);
switch (M.x86.R_AH) { switch (M.x86.R_AH) {
@ -305,7 +305,7 @@ handleInt16(void)
break; break;
default: default:
printf("%s(): unknown function (%x) for int16 handler.\n", printf("%s(): unknown function (%x) for int16 handler.\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n",
M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX,
M.x86.R_DX); M.x86.R_DX);
@ -337,7 +337,7 @@ handleInt1a(void)
// device index in SI (i.e. if multiple devices with same vendor/device id // device index in SI (i.e. if multiple devices with same vendor/device id
// are connected). We currently only support device index 0 // are connected). We currently only support device index 0
DEBUG_PRINTF_INTR("%s(): function: %x: PCI Find Device\n", DEBUG_PRINTF_INTR("%s(): function: %x: PCI Find Device\n",
__FUNCTION__, M.x86.R_AX); __func__, M.x86.R_AX);
if ((M.x86.R_CX == bios_device.pci_device_id) if ((M.x86.R_CX == bios_device.pci_device_id)
&& (M.x86.R_DX == bios_device.pci_vendor_id) && (M.x86.R_DX == bios_device.pci_vendor_id)
// device index must be 0 // device index must be 0
@ -348,11 +348,11 @@ handleInt1a(void)
M.x86.R_BL = bios_device.devfn; M.x86.R_BL = bios_device.devfn;
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Find Device --> 0x%04x\n", ("%s(): function %x: PCI Find Device --> 0x%04x\n",
__FUNCTION__, M.x86.R_AX, M.x86.R_BX); __func__, M.x86.R_AX, M.x86.R_BX);
} else { } else {
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: invalid device/vendor/device index! (%04x/%04x/%02x expected: %04x/%04x/0) \n", ("%s(): function %x: invalid device/vendor/device index! (%04x/%04x/%02x expected: %04x/%04x/0) \n",
__FUNCTION__, M.x86.R_AX, M.x86.R_CX, M.x86.R_DX, __func__, M.x86.R_AX, M.x86.R_CX, M.x86.R_DX,
M.x86.R_SI, bios_device.pci_device_id, M.x86.R_SI, bios_device.pci_device_id,
bios_device.pci_vendor_id); bios_device.pci_vendor_id);
SET_FLAG(F_CF); SET_FLAG(F_CF);
@ -370,7 +370,7 @@ handleInt1a(void)
// fail accesses to any device but ours... // fail accesses to any device but ours...
printf printf
("%s(): Config read access invalid! bus: %x (%x), devfn: %x (%x), offs: %x\n", ("%s(): Config read access invalid! bus: %x (%x), devfn: %x (%x), offs: %x\n",
__FUNCTION__, bus, bios_device.bus, devfn, __func__, bus, bios_device.bus, devfn,
bios_device.devfn, offs); bios_device.devfn, offs);
SET_FLAG(F_CF); SET_FLAG(F_CF);
M.x86.R_AH = 0x87; //return code: bad pci register M.x86.R_AH = 0x87; //return code: bad pci register
@ -390,7 +390,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Read @%02x --> 0x%02x\n", ("%s(): function %x: PCI Config Read @%02x --> 0x%02x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_CL); M.x86.R_CL);
break; break;
case 0xb109: case 0xb109:
@ -405,7 +405,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Read @%02x --> 0x%04x\n", ("%s(): function %x: PCI Config Read @%02x --> 0x%04x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_CX); M.x86.R_CX);
break; break;
case 0xb10a: case 0xb10a:
@ -420,7 +420,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Read @%02x --> 0x%08x\n", ("%s(): function %x: PCI Config Read @%02x --> 0x%08x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_ECX); M.x86.R_ECX);
break; break;
} }
@ -439,7 +439,7 @@ handleInt1a(void)
// fail accesses to any device but ours... // fail accesses to any device but ours...
printf printf
("%s(): Config read access invalid! bus: %x (%x), devfn: %x (%x), offs: %x\n", ("%s(): Config read access invalid! bus: %x (%x), devfn: %x (%x), offs: %x\n",
__FUNCTION__, bus, bios_device.bus, devfn, __func__, bus, bios_device.bus, devfn,
bios_device.devfn, offs); bios_device.devfn, offs);
SET_FLAG(F_CF); SET_FLAG(F_CF);
M.x86.R_AH = 0x87; //return code: bad pci register M.x86.R_AH = 0x87; //return code: bad pci register
@ -456,7 +456,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Write @%02x <-- 0x%02x\n", ("%s(): function %x: PCI Config Write @%02x <-- 0x%02x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_CL); M.x86.R_CL);
break; break;
case 0xb10c: case 0xb10c:
@ -468,7 +468,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Write @%02x <-- 0x%04x\n", ("%s(): function %x: PCI Config Write @%02x <-- 0x%04x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_CX); M.x86.R_CX);
break; break;
case 0xb10d: case 0xb10d:
@ -480,7 +480,7 @@ handleInt1a(void)
#endif #endif
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(): function %x: PCI Config Write @%02x <-- 0x%08x\n", ("%s(): function %x: PCI Config Write @%02x <-- 0x%08x\n",
__FUNCTION__, M.x86.R_AX, offs, __func__, M.x86.R_AX, offs,
M.x86.R_ECX); M.x86.R_ECX);
break; break;
} }
@ -490,7 +490,7 @@ handleInt1a(void)
break; break;
default: default:
printf("%s(): unknown function (%x) for int1a handler.\n", printf("%s(): unknown function (%x) for int1a handler.\n",
__FUNCTION__, M.x86.R_AX); __func__, M.x86.R_AX);
DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n",
M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX,
M.x86.R_DX); M.x86.R_DX);
@ -507,7 +507,7 @@ handleInterrupt(int intNum)
#ifndef DEBUG_PRINT_INT10 #ifndef DEBUG_PRINT_INT10
// this printf makes output by int 10 unreadable... // this printf makes output by int 10 unreadable...
// so we only enable it, if int10 print is disabled // so we only enable it, if int10 print is disabled
DEBUG_PRINTF_INTR("%s(%x)\n", __FUNCTION__, intNum); DEBUG_PRINTF_INTR("%s(%x)\n", __func__, intNum);
#endif #endif
switch (intNum) { switch (intNum) {
case 0x10: //BIOS video interrupt case 0x10: //BIOS video interrupt
@ -521,7 +521,7 @@ handleInterrupt(int intNum)
// ignore interrupt... // ignore interrupt...
DEBUG_PRINTF_INTR DEBUG_PRINTF_INTR
("%s(%x): invalid interrupt Vector (%08x) found, interrupt ignored...\n", ("%s(%x): invalid interrupt Vector (%08x) found, interrupt ignored...\n",
__FUNCTION__, intNum, my_rdl(intNum * 4)); __func__, intNum, my_rdl(intNum * 4));
DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n", DEBUG_PRINTF_INTR("AX=%04x BX=%04x CX=%04x DX=%04x\n",
M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX,
M.x86.R_DX); M.x86.R_DX);
@ -597,9 +597,9 @@ runInt10(void)
} }
setupInt(0x10); setupInt(0x10);
DEBUG_PRINTF_INTR("%s(): starting execution of INT10...\n", DEBUG_PRINTF_INTR("%s(): starting execution of INT10...\n",
__FUNCTION__); __func__);
X86EMU_exec(); X86EMU_exec();
DEBUG_PRINTF_INTR("%s(): execution finished\n", __FUNCTION__); DEBUG_PRINTF_INTR("%s(): execution finished\n", __func__);
} }
// prepare and execute Interrupt 13 (Disk Interrupt) // prepare and execute Interrupt 13 (Disk Interrupt)
@ -636,7 +636,7 @@ runInt13(void)
setupInt(0x13); setupInt(0x13);
DEBUG_PRINTF_INTR("%s(): starting execution of INT13...\n", DEBUG_PRINTF_INTR("%s(): starting execution of INT13...\n",
__FUNCTION__); __func__);
X86EMU_exec(); X86EMU_exec();
DEBUG_PRINTF_INTR("%s(): execution finished\n", __FUNCTION__); DEBUG_PRINTF_INTR("%s(): execution finished\n", __func__);
} }

View file

@ -89,11 +89,11 @@ my_inb(X86EMU_pioAddr addr)
u8 translated = biosemu_dev_translate_address(&translated_addr); u8 translated = biosemu_dev_translate_address(&translated_addr);
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __func__,
addr); addr);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
rval = read_io((void *)translated_addr, 1); rval = read_io((void *)translated_addr, 1);
DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %02x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %02x\n", __func__,
addr, rval); addr, rval);
return rval; return rval;
} else { } else {
@ -101,7 +101,7 @@ my_inb(X86EMU_pioAddr addr)
case 0x61: case 0x61:
//8254 KB Controller / Timer Port //8254 KB Controller / Timer Port
rval = handle_port_61h(); rval = handle_port_61h();
//DEBUG_PRINTF_IO("%s(%04x) KB / Timer Port B --> %02x\n", __FUNCTION__, addr, rval); //DEBUG_PRINTF_IO("%s(%04x) KB / Timer Port B --> %02x\n", __func__, addr, rval);
return rval; return rval;
break; break;
case 0xCFC: case 0xCFC:
@ -121,10 +121,10 @@ my_inb(X86EMU_pioAddr addr)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x) reading from bios_device.io_buffer\n", ("%s(%04x) reading from bios_device.io_buffer\n",
__FUNCTION__, addr); __func__, addr);
rval = *((u8 *) (bios_device.io_buffer + addr)); rval = *((u8 *) (bios_device.io_buffer + addr));
DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %02x\n", DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %02x\n",
__FUNCTION__, addr, rval); __func__, addr, rval);
return rval; return rval;
break; break;
} }
@ -138,9 +138,9 @@ my_inw(X86EMU_pioAddr addr)
u8 translated = biosemu_dev_translate_address(&translated_addr); u8 translated = biosemu_dev_translate_address(&translated_addr);
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __func__,
addr); addr);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
u16 rval; u16 rval;
if ((translated_addr & (u64) 0x1) == 0) { if ((translated_addr & (u64) 0x1) == 0) {
// 16 bit aligned access... // 16 bit aligned access...
@ -152,7 +152,7 @@ my_inw(X86EMU_pioAddr addr)
rval = (read_io((void *)translated_addr, 1) << 8) rval = (read_io((void *)translated_addr, 1) << 8)
| (read_io((void *)(translated_addr + 1), 1)); | (read_io((void *)(translated_addr + 1), 1));
} }
DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %04x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %04x\n", __func__,
addr, rval); addr, rval);
return rval; return rval;
} else { } else {
@ -165,11 +165,11 @@ my_inw(X86EMU_pioAddr addr)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x) reading from bios_device.io_buffer\n", ("%s(%04x) reading from bios_device.io_buffer\n",
__FUNCTION__, addr); __func__, addr);
u16 rval = u16 rval =
in16le((void *) bios_device.io_buffer + addr); in16le((void *) bios_device.io_buffer + addr);
DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %04x\n", DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %04x\n",
__FUNCTION__, addr, rval); __func__, addr, rval);
return rval; return rval;
break; break;
} }
@ -183,9 +183,9 @@ my_inl(X86EMU_pioAddr addr)
u8 translated = biosemu_dev_translate_address(&translated_addr); u8 translated = biosemu_dev_translate_address(&translated_addr);
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%x): access to Device I/O\n", __func__,
addr); addr);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
u32 rval; u32 rval;
if ((translated_addr & (u64) 0x3) == 0) { if ((translated_addr & (u64) 0x3) == 0) {
// 32 bit aligned access... // 32 bit aligned access...
@ -199,7 +199,7 @@ my_inl(X86EMU_pioAddr addr)
| (read_io((void *)(translated_addr + 2), 1) << 8) | (read_io((void *)(translated_addr + 2), 1) << 8)
| (read_io((void *)(translated_addr + 3), 1)); | (read_io((void *)(translated_addr + 3), 1));
} }
DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %08x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O --> %08x\n", __func__,
addr, rval); addr, rval);
return rval; return rval;
} else { } else {
@ -211,11 +211,11 @@ my_inl(X86EMU_pioAddr addr)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x) reading from bios_device.io_buffer\n", ("%s(%04x) reading from bios_device.io_buffer\n",
__FUNCTION__, addr); __func__, addr);
u32 rval = u32 rval =
in32le((void *) bios_device.io_buffer + addr); in32le((void *) bios_device.io_buffer + addr);
DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %08x\n", DEBUG_PRINTF_IO("%s(%04x) I/O Buffer --> %08x\n",
__FUNCTION__, addr, rval); __func__, addr, rval);
return rval; return rval;
break; break;
} }
@ -230,10 +230,10 @@ my_outb(X86EMU_pioAddr addr, u8 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
write_io((void *) translated_addr, val, 1); write_io((void *) translated_addr, val, 1);
DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %02x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %02x\n", __func__,
addr, val); addr, val);
} else { } else {
switch (addr) { switch (addr) {
@ -247,7 +247,7 @@ my_outb(X86EMU_pioAddr addr, u8 val)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x,%02x) writing to bios_device.io_buffer\n", ("%s(%04x,%02x) writing to bios_device.io_buffer\n",
__FUNCTION__, addr, val); __func__, addr, val);
*((u8 *) (bios_device.io_buffer + addr)) = val; *((u8 *) (bios_device.io_buffer + addr)) = val;
break; break;
} }
@ -262,8 +262,8 @@ my_outw(X86EMU_pioAddr addr, u16 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
if ((translated_addr & (u64) 0x1) == 0) { if ((translated_addr & (u64) 0x1) == 0) {
// little-endian conversion // little-endian conversion
u16 tempval = in16le((void *) &val); u16 tempval = in16le((void *) &val);
@ -276,7 +276,7 @@ my_outw(X86EMU_pioAddr addr, u16 val)
write_io(((void *) translated_addr), write_io(((void *) translated_addr),
(u8) (val & 0x00FF), 1); (u8) (val & 0x00FF), 1);
} }
DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %04x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %04x\n", __func__,
addr, val); addr, val);
} else { } else {
switch (addr) { switch (addr) {
@ -288,7 +288,7 @@ my_outw(X86EMU_pioAddr addr, u16 val)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x,%04x) writing to bios_device.io_buffer\n", ("%s(%04x,%04x) writing to bios_device.io_buffer\n",
__FUNCTION__, addr, val); __func__, addr, val);
out16le((void *) bios_device.io_buffer + addr, val); out16le((void *) bios_device.io_buffer + addr, val);
break; break;
} }
@ -303,8 +303,8 @@ my_outl(X86EMU_pioAddr addr, u32 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access Device I/O (BAR or Legacy...) //translation successfull, access Device I/O (BAR or Legacy...)
DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n", DEBUG_PRINTF_IO("%s(%x, %x): access to Device I/O\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_IO("%s(%04x): translated_addr: %llx\n", __func__, addr, translated_addr);
if ((translated_addr & (u64) 0x3) == 0) { if ((translated_addr & (u64) 0x3) == 0) {
// little-endian conversion // little-endian conversion
u32 tempval = in32le((void *) &val); u32 tempval = in32le((void *) &val);
@ -321,7 +321,7 @@ my_outl(X86EMU_pioAddr addr, u32 val)
write_io(((void *) translated_addr), write_io(((void *) translated_addr),
(u8) (val & 0x000000FF), 1); (u8) (val & 0x000000FF), 1);
} }
DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %08x\n", __FUNCTION__, DEBUG_PRINTF_IO("%s(%04x) Device I/O <-- %08x\n", __func__,
addr, val); addr, val);
} else { } else {
switch (addr) { switch (addr) {
@ -332,7 +332,7 @@ my_outl(X86EMU_pioAddr addr, u32 val)
default: default:
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x,%08x) writing to bios_device.io_buffer\n", ("%s(%04x,%08x) writing to bios_device.io_buffer\n",
__FUNCTION__, addr, val); __func__, addr, val);
out32le((void *) bios_device.io_buffer + addr, val); out32le((void *) bios_device.io_buffer + addr, val);
break; break;
} }
@ -384,7 +384,7 @@ pci_cfg_read(X86EMU_pioAddr addr, u8 size)
#endif #endif
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x) PCI Config Read @%02x, size: %d --> 0x%08x\n", ("%s(%04x) PCI Config Read @%02x, size: %d --> 0x%08x\n",
__FUNCTION__, addr, offs, size, rval); __func__, addr, offs, size, rval);
} }
} }
} }
@ -433,7 +433,7 @@ pci_cfg_write(X86EMU_pioAddr addr, u32 val, u8 size)
#endif #endif
DEBUG_PRINTF_IO DEBUG_PRINTF_IO
("%s(%04x) PCI Config Write @%02x, size: %d <-- 0x%08x\n", ("%s(%04x) PCI Config Write @%02x, size: %d <-- 0x%08x\n",
__FUNCTION__, addr, offs, size, val); __func__, addr, offs, size, val);
} }
} }
} }

View file

@ -44,26 +44,26 @@ u32 my_rdl(u32);
/* check Interrupt Vector Access (0000:0000h - 0000:0400h) */ \ /* check Interrupt Vector Access (0000:0000h - 0000:0400h) */ \
if (_addr < 0x400) { \ if (_addr < 0x400) { \
DEBUG_PRINTF_CS_IP("%s: read from Interrupt Vector %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from Interrupt Vector %x --> %x\n", \
__FUNCTION__, _addr / 4, _rval); \ __func__, _addr / 4, _rval); \
} \ } \
/* access to BIOS Data Area (0000:0400h - 0000:0500h)*/ \ /* access to BIOS Data Area (0000:0400h - 0000:0500h)*/ \
else if ((_addr >= 0x400) && (addr < 0x500)) { \ else if ((_addr >= 0x400) && (addr < 0x500)) { \
DEBUG_PRINTF_CS_IP("%s: read from BIOS Data Area: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from BIOS Data Area: addr: %x --> %x\n", \
__FUNCTION__, _addr, _rval); \ __func__, _addr, _rval); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* access to first 64k of memory... */ \ /* access to first 64k of memory... */ \
else if (_addr < 0x10000) { \ else if (_addr < 0x10000) { \
DEBUG_PRINTF_CS_IP("%s: read from segment 0000h: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from segment 0000h: addr: %x --> %x\n", \
__FUNCTION__, _addr, _rval); \ __func__, _addr, _rval); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* read from PMM_CONV_SEGMENT */ \ /* read from PMM_CONV_SEGMENT */ \
else if ((_addr <= ((PMM_CONV_SEGMENT << 4) | 0xffff)) && (_addr >= (PMM_CONV_SEGMENT << 4))) { \ else if ((_addr <= ((PMM_CONV_SEGMENT << 4) | 0xffff)) && (_addr >= (PMM_CONV_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: read from PMM Segment %04xh: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from PMM Segment %04xh: addr: %x --> %x\n", \
__FUNCTION__, PMM_CONV_SEGMENT, _addr, _rval); \ __func__, PMM_CONV_SEGMENT, _addr, _rval); \
/* HALT_SYS(); */ \ /* HALT_SYS(); */ \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
@ -71,7 +71,7 @@ u32 my_rdl(u32);
/* read from PNP_DATA_SEGMENT */ \ /* read from PNP_DATA_SEGMENT */ \
else if ((_addr <= ((PNP_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (PNP_DATA_SEGMENT << 4))) { \ else if ((_addr <= ((PNP_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (PNP_DATA_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: read from PnP Data Segment %04xh: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from PnP Data Segment %04xh: addr: %x --> %x\n", \
__FUNCTION__, PNP_DATA_SEGMENT, _addr, _rval); \ __func__, PNP_DATA_SEGMENT, _addr, _rval); \
/* HALT_SYS(); */ \ /* HALT_SYS(); */ \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
@ -79,12 +79,12 @@ u32 my_rdl(u32);
/* read from EBDA Segment */ \ /* read from EBDA Segment */ \
else if ((_addr <= ((ebda_segment << 4) | (ebda_size - 1))) && (_addr >= (ebda_segment << 4))) { \ else if ((_addr <= ((ebda_segment << 4) | (ebda_size - 1))) && (_addr >= (ebda_segment << 4))) { \
DEBUG_PRINTF_CS_IP("%s: read from Extended BIOS Data Area %04xh, size: %04x: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from Extended BIOS Data Area %04xh, size: %04x: addr: %x --> %x\n", \
__FUNCTION__, ebda_segment, ebda_size, _addr, _rval); \ __func__, ebda_segment, ebda_size, _addr, _rval); \
} \ } \
/* read from BIOS_DATA_SEGMENT */ \ /* read from BIOS_DATA_SEGMENT */ \
else if ((_addr <= ((BIOS_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (BIOS_DATA_SEGMENT << 4))) { \ else if ((_addr <= ((BIOS_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (BIOS_DATA_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: read from BIOS Data Segment %04xh: addr: %x --> %x\n", \ DEBUG_PRINTF_CS_IP("%s: read from BIOS Data Segment %04xh: addr: %x --> %x\n", \
__FUNCTION__, BIOS_DATA_SEGMENT, _addr, _rval); \ __func__, BIOS_DATA_SEGMENT, _addr, _rval); \
/* for PMM debugging */ \ /* for PMM debugging */ \
/*if (_addr == BIOS_DATA_SEGMENT << 4) { \ /*if (_addr == BIOS_DATA_SEGMENT << 4) { \
X86EMU_trace_on(); \ X86EMU_trace_on(); \
@ -107,52 +107,52 @@ u32 my_rdl(u32);
/* check Interrupt Vector Access (0000:0000h - 0000:0400h) */ \ /* check Interrupt Vector Access (0000:0000h - 0000:0400h) */ \
if (_addr < 0x400) { \ if (_addr < 0x400) { \
DEBUG_PRINTF_CS_IP("%s: write to Interrupt Vector %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to Interrupt Vector %x <-- %x\n", \
__FUNCTION__, _addr / 4, _val); \ __func__, _addr / 4, _val); \
} \ } \
/* access to BIOS Data Area (0000:0400h - 0000:0500h)*/ \ /* access to BIOS Data Area (0000:0400h - 0000:0500h)*/ \
else if ((_addr >= 0x400) && (addr < 0x500)) { \ else if ((_addr >= 0x400) && (addr < 0x500)) { \
DEBUG_PRINTF_CS_IP("%s: write to BIOS Data Area: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to BIOS Data Area: addr: %x <-- %x\n", \
__FUNCTION__, _addr, _val); \ __func__, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* access to first 64k of memory...*/ \ /* access to first 64k of memory...*/ \
else if (_addr < 0x10000) { \ else if (_addr < 0x10000) { \
DEBUG_PRINTF_CS_IP("%s: write to segment 0000h: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to segment 0000h: addr: %x <-- %x\n", \
__FUNCTION__, _addr, _val); \ __func__, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* write to PMM_CONV_SEGMENT... */ \ /* write to PMM_CONV_SEGMENT... */ \
else if ((_addr <= ((PMM_CONV_SEGMENT << 4) | 0xffff)) && (_addr >= (PMM_CONV_SEGMENT << 4))) { \ else if ((_addr <= ((PMM_CONV_SEGMENT << 4) | 0xffff)) && (_addr >= (PMM_CONV_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: write to PMM Segment %04xh: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to PMM Segment %04xh: addr: %x <-- %x\n", \
__FUNCTION__, PMM_CONV_SEGMENT, _addr, _val); \ __func__, PMM_CONV_SEGMENT, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* write to PNP_DATA_SEGMENT... */ \ /* write to PNP_DATA_SEGMENT... */ \
else if ((_addr <= ((PNP_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (PNP_DATA_SEGMENT << 4))) { \ else if ((_addr <= ((PNP_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (PNP_DATA_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: write to PnP Data Segment %04xh: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to PnP Data Segment %04xh: addr: %x <-- %x\n", \
__FUNCTION__, PNP_DATA_SEGMENT, _addr, _val); \ __func__, PNP_DATA_SEGMENT, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* write to EBDA Segment... */ \ /* write to EBDA Segment... */ \
else if ((_addr <= ((ebda_segment << 4) | (ebda_size - 1))) && (_addr >= (ebda_segment << 4))) { \ else if ((_addr <= ((ebda_segment << 4) | (ebda_size - 1))) && (_addr >= (ebda_segment << 4))) { \
DEBUG_PRINTF_CS_IP("%s: write to Extended BIOS Data Area %04xh, size: %04x: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to Extended BIOS Data Area %04xh, size: %04x: addr: %x <-- %x\n", \
__FUNCTION__, ebda_segment, ebda_size, _addr, _val); \ __func__, ebda_segment, ebda_size, _addr, _val); \
} \ } \
/* write to BIOS_DATA_SEGMENT... */ \ /* write to BIOS_DATA_SEGMENT... */ \
else if ((_addr <= ((BIOS_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (BIOS_DATA_SEGMENT << 4))) { \ else if ((_addr <= ((BIOS_DATA_SEGMENT << 4) | 0xffff)) && (_addr >= (BIOS_DATA_SEGMENT << 4))) { \
DEBUG_PRINTF_CS_IP("%s: write to BIOS Data Segment %04xh: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to BIOS Data Segment %04xh: addr: %x <-- %x\n", \
__FUNCTION__, BIOS_DATA_SEGMENT, _addr, _val); \ __func__, BIOS_DATA_SEGMENT, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
/* write to current CS segment... */ \ /* write to current CS segment... */ \
else if ((_addr < ((M.x86.R_CS << 4) | 0xffff)) && (_addr > (M.x86.R_CS << 4))) { \ else if ((_addr < ((M.x86.R_CS << 4) | 0xffff)) && (_addr > (M.x86.R_CS << 4))) { \
DEBUG_PRINTF_CS_IP("%s: write to CS segment %04xh: addr: %x <-- %x\n", \ DEBUG_PRINTF_CS_IP("%s: write to CS segment %04xh: addr: %x <-- %x\n", \
__FUNCTION__, M.x86.R_CS, _addr, _val); \ __func__, M.x86.R_CS, _addr, _val); \
/* dump registers */ \ /* dump registers */ \
/* x86emu_dump_xregs(); */ \ /* x86emu_dump_xregs(); */ \
} \ } \
@ -178,17 +178,17 @@ my_rdb(u32 addr)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%08x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%08x): access to VGA Memory\n",
__FUNCTION__, addr); __func__, addr);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
set_ci(); set_ci();
rval = *((u8 *) translated_addr); rval = *((u8 *) translated_addr);
clr_ci(); clr_ci();
DEBUG_PRINTF_MEM("%s(%08x) VGA --> %02x\n", __FUNCTION__, addr, DEBUG_PRINTF_MEM("%s(%08x) VGA --> %02x\n", __func__, addr,
rval); rval);
return rval; return rval;
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {
@ -210,8 +210,8 @@ my_rdw(u32 addr)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%08x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%08x): access to VGA Memory\n",
__FUNCTION__, addr); __func__, addr);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
// check for legacy memory, because of the remapping to BARs, the reads must // check for legacy memory, because of the remapping to BARs, the reads must
// be byte reads... // be byte reads...
if ((addr >= 0xa0000) && (addr < 0xc0000)) { if ((addr >= 0xa0000) && (addr < 0xc0000)) {
@ -234,12 +234,12 @@ my_rdw(u32 addr)
clr_ci(); clr_ci();
} }
} }
DEBUG_PRINTF_MEM("%s(%08x) VGA --> %04x\n", __FUNCTION__, addr, DEBUG_PRINTF_MEM("%s(%08x) VGA --> %04x\n", __func__, addr,
rval); rval);
return rval; return rval;
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {
@ -261,8 +261,8 @@ my_rdl(u32 addr)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%x): access to VGA Memory\n",
__FUNCTION__, addr); __func__, addr);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
// check for legacy memory, because of the remapping to BARs, the reads must // check for legacy memory, because of the remapping to BARs, the reads must
// be byte reads... // be byte reads...
if ((addr >= 0xa0000) && (addr < 0xc0000)) { if ((addr >= 0xa0000) && (addr < 0xc0000)) {
@ -289,13 +289,13 @@ my_rdl(u32 addr)
clr_ci(); clr_ci();
} }
} }
DEBUG_PRINTF_MEM("%s(%08x) VGA --> %08x\n", __FUNCTION__, addr, DEBUG_PRINTF_MEM("%s(%08x) VGA --> %08x\n", __func__, addr,
rval); rval);
//HALT_SYS(); //HALT_SYS();
return rval; return rval;
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {
@ -323,14 +323,14 @@ my_wrb(u32 addr, u8 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
set_ci(); set_ci();
*((u8 *) translated_addr) = val; *((u8 *) translated_addr) = val;
clr_ci(); clr_ci();
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {
@ -348,8 +348,8 @@ my_wrw(u32 addr, u16 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
// check for legacy memory, because of the remapping to BARs, the reads must // check for legacy memory, because of the remapping to BARs, the reads must
// be byte reads... // be byte reads...
if ((addr >= 0xa0000) && (addr < 0xc0000)) { if ((addr >= 0xa0000) && (addr < 0xc0000)) {
@ -376,7 +376,7 @@ my_wrw(u32 addr, u16 val)
} }
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {
@ -393,8 +393,8 @@ my_wrl(u32 addr, u32 val)
if (translated != 0) { if (translated != 0) {
//translation successfull, access VGA Memory (BAR or Legacy...) //translation successfull, access VGA Memory (BAR or Legacy...)
DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n", DEBUG_PRINTF_MEM("%s(%x, %x): access to VGA Memory\n",
__FUNCTION__, addr, val); __func__, addr, val);
//DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __FUNCTION__, addr, translated_addr); //DEBUG_PRINTF_MEM("%s(%08x): translated_addr: %llx\n", __func__, addr, translated_addr);
// check for legacy memory, because of the remapping to BARs, the reads must // check for legacy memory, because of the remapping to BARs, the reads must
// be byte reads... // be byte reads...
if ((addr >= 0xa0000) && (addr < 0xc0000)) { if ((addr >= 0xa0000) && (addr < 0xc0000)) {
@ -427,7 +427,7 @@ my_wrl(u32 addr, u32 val)
} }
} else if (addr > M.mem_size) { } else if (addr > M.mem_size) {
DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n", DEBUG_PRINTF("%s(%08x): Memory Access out of range!\n",
__FUNCTION__, addr); __func__, addr);
//disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1); //disassemble_forward(M.x86.saved_cs, M.x86.saved_ip, 1);
HALT_SYS(); HALT_SYS();
} else { } else {

View file

@ -109,13 +109,13 @@ void pmm_handleInt()
flags = pop_word(); flags = pop_word();
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmAllocate: Length: %x, Handle: %x, Flags: %x\n", ("%s: pmmAllocate: Length: %x, Handle: %x, Flags: %x\n",
__FUNCTION__, length, handle, flags); __func__, length, handle, flags);
if ((flags & 0x1) != 0) { if ((flags & 0x1) != 0) {
/* request to allocate in conventional memory */ /* request to allocate in conventional memory */
if (curr_pmm_allocation_index >= MAX_PMM_AREAS) { if (curr_pmm_allocation_index >= MAX_PMM_AREAS) {
printf printf
("%s: pmmAllocate: Maximum Number of allocatable areas reached (%d), cannot allocate more memory!\n", ("%s: pmmAllocate: Maximum Number of allocatable areas reached (%d), cannot allocate more memory!\n",
__FUNCTION__, MAX_PMM_AREAS); __func__, MAX_PMM_AREAS);
rval = 0; rval = 0;
goto exit; goto exit;
} }
@ -133,7 +133,7 @@ void pmm_handleInt()
[curr_pmm_allocation_index - 1].length; [curr_pmm_allocation_index - 1].length;
} }
DEBUG_PRINTF_PMM("%s: next_offset: 0x%x\n", DEBUG_PRINTF_PMM("%s: next_offset: 0x%x\n",
__FUNCTION__, next_offset); __func__, next_offset);
if (length == 0) { if (length == 0) {
/* largest possible block size requested, we have on segment /* largest possible block size requested, we have on segment
* to allocate, so largest possible is segment size (0xFFFF) * to allocate, so largest possible is segment size (0xFFFF)
@ -158,7 +158,7 @@ void pmm_handleInt()
if (align < 0x10) { if (align < 0x10) {
align = 0x10; align = 0x10;
} }
DEBUG_PRINTF_PMM("%s: align: 0x%x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: align: 0x%x\n", __func__,
align); align);
if ((next_offset & (align - 1)) != 0) { if ((next_offset & (align - 1)) != 0) {
/* not yet aligned... align! */ /* not yet aligned... align! */
@ -169,7 +169,7 @@ void pmm_handleInt()
rval = 0; rval = 0;
printf printf
("%s: pmmAllocate: Not enough memory available for allocation!\n", ("%s: pmmAllocate: Not enough memory available for allocation!\n",
__FUNCTION__); __func__);
goto exit; goto exit;
} }
curr_pmm_allocation_index++; curr_pmm_allocation_index++;
@ -181,25 +181,25 @@ void pmm_handleInt()
rval = ((u32) (PMM_CONV_SEGMENT << 16)) | next_offset; rval = ((u32) (PMM_CONV_SEGMENT << 16)) | next_offset;
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmAllocate: allocated memory at %x\n", ("%s: pmmAllocate: allocated memory at %x\n",
__FUNCTION__, rval); __func__, rval);
} else { } else {
rval = 0; rval = 0;
printf printf
("%s: pmmAllocate: allocation in extended memory not supported!\n", ("%s: pmmAllocate: allocation in extended memory not supported!\n",
__FUNCTION__); __func__);
} }
goto exit; goto exit;
case 1: case 1:
/* function pmmFind */ /* function pmmFind */
handle = pop_long(); /* the handle to lookup */ handle = pop_long(); /* the handle to lookup */
DEBUG_PRINTF_PMM("%s: pmmFind: Handle: %x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: pmmFind: Handle: %x\n", __func__,
handle); handle);
i = 0; i = 0;
for (i = 0; i < curr_pmm_allocation_index; i++) { for (i = 0; i < curr_pmm_allocation_index; i++) {
if (pmm_allocation_array[i].handle == handle) { if (pmm_allocation_array[i].handle == handle) {
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmFind: found allocated memory at %x\n", ("%s: pmmFind: found allocated memory at %x\n",
__FUNCTION__, rval); __func__, rval);
/* return the 32bit "physical" address, i.e. combination of segment and offset */ /* return the 32bit "physical" address, i.e. combination of segment and offset */
rval = rval =
((u32) (PMM_CONV_SEGMENT << 16)) | ((u32) (PMM_CONV_SEGMENT << 16)) |
@ -209,7 +209,7 @@ void pmm_handleInt()
if (rval == 0) { if (rval == 0) {
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmFind: handle (%x) not found!\n", ("%s: pmmFind: handle (%x) not found!\n",
__FUNCTION__, handle); __func__, handle);
} }
goto exit; goto exit;
case 2: case 2:
@ -220,7 +220,7 @@ void pmm_handleInt()
*/ */
buffer = buffer ^ ((u32) PMM_CONV_SEGMENT << 16); buffer = buffer ^ ((u32) PMM_CONV_SEGMENT << 16);
DEBUG_PRINTF_PMM("%s: pmmDeallocate: PMM segment offset: %x\n", DEBUG_PRINTF_PMM("%s: pmmDeallocate: PMM segment offset: %x\n",
__FUNCTION__, buffer); __func__, buffer);
i = 0; i = 0;
/* rval = 0 means we deallocated the buffer, so set it to 1 in case we dont find it and /* rval = 0 means we deallocated the buffer, so set it to 1 in case we dont find it and
* thus cannot deallocate * thus cannot deallocate
@ -234,7 +234,7 @@ void pmm_handleInt()
rval = 0; rval = 0;
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmDeallocate: found allocated memory at index: %d\n", ("%s: pmmDeallocate: found allocated memory at index: %d\n",
__FUNCTION__, i); __func__, i);
/* copy the remaining elements in pmm_allocation_array one position up */ /* copy the remaining elements in pmm_allocation_array one position up */
j = i; j = i;
for (; j < curr_pmm_allocation_index; j++) { for (; j < curr_pmm_allocation_index; j++) {
@ -256,13 +256,13 @@ void pmm_handleInt()
if (rval != 0) { if (rval != 0) {
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: pmmDeallocate: offset (%x) not found, cannot deallocate!\n", ("%s: pmmDeallocate: offset (%x) not found, cannot deallocate!\n",
__FUNCTION__, buffer); __func__, buffer);
} }
goto exit; goto exit;
default: default:
/* invalid/unimplemented function */ /* invalid/unimplemented function */
printf("%s: invalid PMM function (0x%04x) called!\n", printf("%s: invalid PMM function (0x%04x) called!\n",
__FUNCTION__, function); __func__, function);
/* PMM spec says if function is invalid, return 0xFFFFFFFF */ /* PMM spec says if function is invalid, return 0xFFFFFFFF */
rval = 0xFFFFFFFF; rval = 0xFFFFFFFF;
goto exit; goto exit;
@ -274,7 +274,7 @@ void pmm_handleInt()
M.x86.R_AX = (u16) (rval & 0xFFFF); M.x86.R_AX = (u16) (rval & 0xFFFF);
CHECK_DBG(DEBUG_PMM) { CHECK_DBG(DEBUG_PMM) {
DEBUG_PRINTF_PMM("%s: dump of pmm_allocation_array:\n", DEBUG_PRINTF_PMM("%s: dump of pmm_allocation_array:\n",
__FUNCTION__); __func__);
for (i = 0; i < MAX_PMM_AREAS; i++) { for (i = 0; i < MAX_PMM_AREAS; i++) {
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%d:\n\thandle: %x\n\toffset: %x\n\tlength: %x\n", ("%d:\n\thandle: %x\n\toffset: %x\n\tlength: %x\n",
@ -304,7 +304,7 @@ void pmm_test(void)
push_long(0); /* This is the return address for the ABI, unused in this implementation */ push_long(0); /* This is the return address for the ABI, unused in this implementation */
pmm_handleInt(); pmm_handleInt();
addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__,
M.x86.R_DX, M.x86.R_AX); M.x86.R_DX, M.x86.R_AX);
function = 1; /* pmmFind */ function = 1; /* pmmFind */
push_long(handle); push_long(handle);
@ -312,7 +312,7 @@ void pmm_test(void)
push_long(0); /* This is the return address for the ABI, unused in this implementation */ push_long(0); /* This is the return address for the ABI, unused in this implementation */
pmm_handleInt(); pmm_handleInt();
DEBUG_PRINTF_PMM("%s: found memory at: %04x:%04x (expected: %08x)\n", DEBUG_PRINTF_PMM("%s: found memory at: %04x:%04x (expected: %08x)\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX, addr); __func__, M.x86.R_DX, M.x86.R_AX, addr);
function = 2; /* pmmDeallocate */ function = 2; /* pmmDeallocate */
push_long(addr); push_long(addr);
push_word(function); push_word(function);
@ -320,7 +320,7 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n", ("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX); __func__, M.x86.R_DX, M.x86.R_AX);
/*-------------------- Test aligned allocation/deallocation ----------------------------- */ /*-------------------- Test aligned allocation/deallocation ----------------------------- */
function = 0; /* pmmAllocate */ function = 0; /* pmmAllocate */
handle = 0xdeadbeef; handle = 0xdeadbeef;
@ -334,7 +334,7 @@ void pmm_test(void)
push_long(0); /* This is the return address for the ABI, unused in this implementation */ push_long(0); /* This is the return address for the ABI, unused in this implementation */
pmm_handleInt(); pmm_handleInt();
addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__,
M.x86.R_DX, M.x86.R_AX); M.x86.R_DX, M.x86.R_AX);
function = 0; /* pmmAllocate */ function = 0; /* pmmAllocate */
handle = 0xf00d4b0b; handle = 0xf00d4b0b;
@ -349,7 +349,7 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
/* the address should be aligned to 0x800, so probably it is at offset 0x1800... */ /* the address should be aligned to 0x800, so probably it is at offset 0x1800... */
addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__,
M.x86.R_DX, M.x86.R_AX); M.x86.R_DX, M.x86.R_AX);
function = 1; /* pmmFind */ function = 1; /* pmmFind */
push_long(handle); push_long(handle);
@ -364,7 +364,7 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n", ("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX); __func__, M.x86.R_DX, M.x86.R_AX);
handle = 0xdeadbeef; handle = 0xdeadbeef;
function = 1; /* pmmFind */ function = 1; /* pmmFind */
push_long(handle); push_long(handle);
@ -379,7 +379,7 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n", ("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX); __func__, M.x86.R_DX, M.x86.R_AX);
/*-------------------- Test out of memory allocation ----------------------------- */ /*-------------------- Test out of memory allocation ----------------------------- */
function = 0; /* pmmAllocate */ function = 0; /* pmmAllocate */
handle = 0xdeadbeef; handle = 0xdeadbeef;
@ -394,7 +394,7 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
length = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; length = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
length /= 16; /* length in paragraphs */ length /= 16; /* length in paragraphs */
DEBUG_PRINTF_PMM("%s: largest possible length: %08x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: largest possible length: %08x\n", __func__,
length); length);
function = 0; /* pmmAllocate */ function = 0; /* pmmAllocate */
flags = 0x1; /* conventional memory, aligned */ flags = 0x1; /* conventional memory, aligned */
@ -406,7 +406,7 @@ void pmm_test(void)
push_long(0); /* This is the return address for the ABI, unused in this implementation */ push_long(0); /* This is the return address for the ABI, unused in this implementation */
pmm_handleInt(); pmm_handleInt();
addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __FUNCTION__, DEBUG_PRINTF_PMM("%s: allocated memory at: %04x:%04x\n", __func__,
M.x86.R_DX, M.x86.R_AX); M.x86.R_DX, M.x86.R_AX);
function = 0; /* pmmAllocate */ function = 0; /* pmmAllocate */
length = 1; length = 1;
@ -423,7 +423,7 @@ void pmm_test(void)
addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX; addr = ((u32) M.x86.R_DX << 16) | M.x86.R_AX;
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: allocated memory at: %04x:%04x expected: 0000:0000\n", ("%s: allocated memory at: %04x:%04x expected: 0000:0000\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX); __func__, M.x86.R_DX, M.x86.R_AX);
handle = 0xdeadbeef; handle = 0xdeadbeef;
function = 1; /* pmmFind */ function = 1; /* pmmFind */
push_long(handle); push_long(handle);
@ -438,5 +438,5 @@ void pmm_test(void)
pmm_handleInt(); pmm_handleInt();
DEBUG_PRINTF_PMM DEBUG_PRINTF_PMM
("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n", ("%s: freed memory rval: %04x:%04x (expected: 0000:0000)\n",
__FUNCTION__, M.x86.R_DX, M.x86.R_AX); __func__, M.x86.R_DX, M.x86.R_AX);
} }

View file

@ -129,14 +129,14 @@ vbe_info(vbe_info_t * info)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE("%s: VBE Info Function NOT supported! AL=%x\n", DEBUG_PRINTF_VBE("%s: VBE Info Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Info Function Return Code NOT OK! AH=%x\n", ("%s: VBE Info Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
//printf("VBE Info Dump:"); //printf("VBE Info Dump:");
@ -200,14 +200,14 @@ vbe_get_mode_info(vbe_mode_info_t * mode_info)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Return Mode Info Function NOT supported! AL=%x\n", ("%s: VBE Return Mode Info Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Return Mode Info (mode: %04x) Function Return Code NOT OK! AH=%02x\n", ("%s: VBE Return Mode Info (mode: %04x) Function Return Code NOT OK! AH=%02x\n",
__FUNCTION__, mode_info->video_mode, M.x86.R_AH); __func__, mode_info->video_mode, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
//pointer to mode_info_block is in ES:DI //pointer to mode_info_block is in ES:DI
@ -260,7 +260,7 @@ vbe_set_mode(vbe_mode_info_t * mode_info)
M.x86.R_BX |= 0x4000; // set bit 14 to request linear framebuffer mode M.x86.R_BX |= 0x4000; // set bit 14 to request linear framebuffer mode
M.x86.R_BX &= 0x7FFF; // clear bit 15 to request clearing of framebuffer M.x86.R_BX &= 0x7FFF; // clear bit 15 to request clearing of framebuffer
DEBUG_PRINTF_VBE("%s: setting mode: 0x%04x\n", __FUNCTION__, DEBUG_PRINTF_VBE("%s: setting mode: 0x%04x\n", __func__,
M.x86.R_BX); M.x86.R_BX);
// enable trace // enable trace
@ -273,14 +273,14 @@ vbe_set_mode(vbe_mode_info_t * mode_info)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Mode Function NOT supported! AL=%x\n", ("%s: VBE Set Mode Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: mode: %x VBE Set Mode Function Return Code NOT OK! AH=%x\n", ("%s: mode: %x VBE Set Mode Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, mode_info->video_mode, M.x86.R_AH); __func__, mode_info->video_mode, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
return 0; return 0;
@ -296,7 +296,7 @@ vbe_set_palette_format(u8 format)
M.x86.R_BL = 0x00; // set format M.x86.R_BL = 0x00; // set format
M.x86.R_BH = format; M.x86.R_BH = format;
DEBUG_PRINTF_VBE("%s: setting palette format: %d\n", __FUNCTION__, DEBUG_PRINTF_VBE("%s: setting palette format: %d\n", __func__,
format); format);
// enable trace // enable trace
@ -309,14 +309,14 @@ vbe_set_palette_format(u8 format)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Format Function NOT supported! AL=%x\n", ("%s: VBE Set Palette Format Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Format Function Return Code NOT OK! AH=%x\n", ("%s: VBE Set Palette Format Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
return 0; return 0;
@ -339,7 +339,7 @@ vbe_set_color(u16 color_number, u32 color_value)
// store color value at ES:DI // store color value at ES:DI
out32le(biosmem + (M.x86.R_ES << 4) + M.x86.R_DI, color_value); out32le(biosmem + (M.x86.R_ES << 4) + M.x86.R_DI, color_value);
DEBUG_PRINTF_VBE("%s: setting color #%x: 0x%04x\n", __FUNCTION__, DEBUG_PRINTF_VBE("%s: setting color #%x: 0x%04x\n", __func__,
color_number, color_value); color_number, color_value);
// enable trace // enable trace
@ -352,14 +352,14 @@ vbe_set_color(u16 color_number, u32 color_value)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Function NOT supported! AL=%x\n", ("%s: VBE Set Palette Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Function Return Code NOT OK! AH=%x\n", ("%s: VBE Set Palette Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
return 0; return 0;
@ -388,20 +388,20 @@ vbe_get_color(u16 color_number, u32 * color_value)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Function NOT supported! AL=%x\n", ("%s: VBE Set Palette Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Set Palette Function Return Code NOT OK! AH=%x\n", ("%s: VBE Set Palette Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, M.x86.R_AH); __func__, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
// read color value from ES:DI // read color value from ES:DI
*color_value = in32le(biosmem + (M.x86.R_ES << 4) + M.x86.R_DI); *color_value = in32le(biosmem + (M.x86.R_ES << 4) + M.x86.R_DI);
DEBUG_PRINTF_VBE("%s: getting color #%x --> 0x%04x\n", __FUNCTION__, DEBUG_PRINTF_VBE("%s: getting color #%x --> 0x%04x\n", __func__,
color_number, *color_value); color_number, *color_value);
return 0; return 0;
@ -429,14 +429,14 @@ vbe_get_ddc_info(vbe_ddc_info_t * ddc_info)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Get DDC Info Function NOT supported! AL=%x\n", ("%s: VBE Get DDC Info Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: port: %x VBE Get DDC Info Function Return Code NOT OK! AH=%x\n", ("%s: port: %x VBE Get DDC Info Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, ddc_info->port_number, M.x86.R_AH); __func__, ddc_info->port_number, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
// BH = approx. time in seconds to transfer one EDID block // BH = approx. time in seconds to transfer one EDID block
@ -464,14 +464,14 @@ vbe_get_ddc_info(vbe_ddc_info_t * ddc_info)
if (M.x86.R_AL != 0x4f) { if (M.x86.R_AL != 0x4f) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: VBE Read EDID Function NOT supported! AL=%x\n", ("%s: VBE Read EDID Function NOT supported! AL=%x\n",
__FUNCTION__, M.x86.R_AL); __func__, M.x86.R_AL);
return -1; return -1;
} }
if (M.x86.R_AH != 0x0) { if (M.x86.R_AH != 0x0) {
DEBUG_PRINTF_VBE DEBUG_PRINTF_VBE
("%s: port: %x VBE Read EDID Function Return Code NOT OK! AH=%x\n", ("%s: port: %x VBE Read EDID Function Return Code NOT OK! AH=%x\n",
__FUNCTION__, ddc_info->port_number, M.x86.R_AH); __func__, ddc_info->port_number, M.x86.R_AH);
return M.x86.R_AH; return M.x86.R_AH;
} }
@ -565,13 +565,13 @@ vbe_get_info(u8 argc, char ** argv)
if (strncmp((char *) input.signature, "DDC", 4) != 0) { if (strncmp((char *) input.signature, "DDC", 4) != 0) {
printf printf
("%s: Invalid input signature! expected: %s, is: %s\n", ("%s: Invalid input signature! expected: %s, is: %s\n",
__FUNCTION__, "DDC", input.signature); __func__, "DDC", input.signature);
return -1; return -1;
} }
if (input.size_reserved != sizeof(screen_info_t)) { if (input.size_reserved != sizeof(screen_info_t)) {
printf printf
("%s: Size of return struct is wrong, required: %d, available: %d\n", ("%s: Size of return struct is wrong, required: %d, available: %d\n",
__FUNCTION__, (int) sizeof(screen_info_t), __func__, (int) sizeof(screen_info_t),
input.size_reserved); input.size_reserved);
return -1; return -1;
} }
@ -765,7 +765,7 @@ vbe_get_info(u8 argc, char ** argv)
output->framebuffer_address = output->framebuffer_address =
best_mode_info.framebuffer_address; best_mode_info.framebuffer_address;
} else { } else {
printf("%s: No suitable video mode found!\n", __FUNCTION__); printf("%s: No suitable video mode found!\n", __func__);
//unset display_type... //unset display_type...
output->display_type = 0; output->display_type = 0;
} }