2020-09-21 19:06:05 +03:00
|
|
|
/*
|
2021-03-19 11:44:42 +03:00
|
|
|
* QTest testcases for ich9 case
|
2020-09-21 19:06:05 +03:00
|
|
|
*
|
|
|
|
* Copyright (c) 2020 Li Qiang <liq3ea@gmail.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
|
2022-03-30 12:39:05 +03:00
|
|
|
#include "libqtest.h"
|
2020-09-21 19:06:05 +03:00
|
|
|
|
2020-11-02 19:33:36 +03:00
|
|
|
static void test_lp1878642_pci_bus_get_irq_level_assert(void)
|
|
|
|
{
|
|
|
|
QTestState *s;
|
|
|
|
|
|
|
|
s = qtest_init("-M pc-q35-5.0 "
|
2021-02-16 21:13:15 +03:00
|
|
|
"-nographic -monitor none -serial none");
|
2020-11-02 19:33:36 +03:00
|
|
|
|
2021-03-19 11:44:42 +03:00
|
|
|
qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */
|
|
|
|
qtest_outl(s, 0xcfc, 0x5d00);
|
|
|
|
qtest_outl(s, 0xcf8, 0x8000f844); /* ACPI_CTRL */
|
|
|
|
qtest_outl(s, 0xcfc, 0xeb);
|
|
|
|
qtest_outw(s, 0x5d02, 0x205d);
|
2020-12-01 22:10:23 +03:00
|
|
|
qtest_quit(s);
|
2020-11-02 19:33:36 +03:00
|
|
|
}
|
|
|
|
|
2020-09-21 19:06:05 +03:00
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
const char *arch = qtest_get_arch();
|
|
|
|
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
|
|
|
|
|
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
2021-03-19 11:44:42 +03:00
|
|
|
qtest_add_func("ich9/test_lp1878642_pci_bus_get_irq_level_assert",
|
2020-11-02 19:33:36 +03:00
|
|
|
test_lp1878642_pci_bus_get_irq_level_assert);
|
2020-09-21 19:06:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return g_test_run();
|
|
|
|
}
|