dsdt_anycpu_qemu_xen.asl: dsdt.asl mk_dsdt
awk 'NR > 1 {print s} {s=$$0}' $< > $@
- ./mk_dsdt --dm-version qemu-xen >> $@
+ ./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@
# NB. awk invocation is a portable alternative to 'head -n -1'
dsdt_%cpu.asl: dsdt.asl mk_dsdt
awk 'NR > 1 {print s} {s=$$0}' $< > $@
- ./mk_dsdt --maxcpu $* >> $@
+ ./mk_dsdt --debug=$(debug) --maxcpu $* >> $@
$(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl
iasl -vs -p $* -tc $*.asl
#include <string.h>
#include <getopt.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <xen/hvm/hvm_info_table.h>
static unsigned int indent_level;
+static bool debug = false;
typedef enum dm_version {
QEMU_XEN_TRADITIONAL,
static struct option options[] = {
{ "maxcpu", 1, 0, 'c' },
{ "dm-version", 1, 0, 'q' },
+ { "debug", 1, 0, 'd' },
{ 0, 0, 0, 0 }
};
return -1;
}
break;
+ case 'd':
+ if (*optarg == 'y')
+ debug = true;
+ break;
default:
return -1;
}
/* _SUN == dev */
stmt("Name", "_SUN, 0x%08x", slot >> 3);
push_block("Method", "_EJ0, 1");
- stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
- stmt("Store", "0x88, \\_GPE.DPT2");
+ if (debug)
+ {
+ stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
+ stmt("Store", "0x88, \\_GPE.DPT2");
+ }
stmt("Store", "0x%02x, \\_GPE.PH%02X", /* eject */
(slot & 1) ? 0x10 : 0x01, slot & ~1);
pop_block();
push_block("Method", "_STA, 0");
- stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
- stmt("Store", "0x89, \\_GPE.DPT2");
+ if (debug)
+ {
+ stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
+ stmt("Store", "0x89, \\_GPE.DPT2");
+ }
if ( slot & 1 )
stmt("ShiftRight", "0x4, \\_GPE.PH%02X, Local1", slot & ~1);
else
stmt("And", "Local1, 0xf, EVT");
stmt("Store", "PSTB, Local1"); /* XXX: Store (PSTB, SLT) ? */
stmt("And", "Local1, 0xff, SLT");
- /* Debug */
- stmt("Store", "SLT, DPT1");
- stmt("Store", "EVT, DPT2");
+ if (debug)
+ {
+ stmt("Store", "SLT, DPT1");
+ stmt("Store", "EVT, DPT2");
+ }
/* Decision tree */
decision_tree(0x00, 0x100, "SLT", pci_hotplug_notify);
pop_block();