Li Qiang | d8dd109 | 2020-09-21 09:06:05 -0700 | [diff] [blame] | 1 | /* |
Paolo Bonzini | af05fff | 2021-03-19 04:44:42 -0400 | [diff] [blame] | 2 | * QTest testcases for ich9 case |
Li Qiang | d8dd109 | 2020-09-21 09:06:05 -0700 | [diff] [blame] | 3 | * |
| 4 | * Copyright (c) 2020 Li Qiang <liq3ea@gmail.com> |
| 5 | * |
| 6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 7 | * See the COPYING file in the top-level directory. |
| 8 | */ |
| 9 | |
| 10 | #include "qemu/osdep.h" |
| 11 | |
Marc-André Lureau | 907b510 | 2022-03-30 13:39:05 +0400 | [diff] [blame] | 12 | #include "libqtest.h" |
Li Qiang | d8dd109 | 2020-09-21 09:06:05 -0700 | [diff] [blame] | 13 | |
Alexander Bulekov | fd25017 | 2020-11-02 11:33:36 -0500 | [diff] [blame] | 14 | static void test_lp1878642_pci_bus_get_irq_level_assert(void) |
| 15 | { |
| 16 | QTestState *s; |
| 17 | |
| 18 | s = qtest_init("-M pc-q35-5.0 " |
Alexander Bulekov | c8ffacb | 2021-02-16 13:13:15 -0500 | [diff] [blame] | 19 | "-nographic -monitor none -serial none"); |
Alexander Bulekov | fd25017 | 2020-11-02 11:33:36 -0500 | [diff] [blame] | 20 | |
Paolo Bonzini | af05fff | 2021-03-19 04:44:42 -0400 | [diff] [blame] | 21 | qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ |
| 22 | qtest_outl(s, 0xcfc, 0x5d00); |
| 23 | qtest_outl(s, 0xcf8, 0x8000f844); /* ACPI_CTRL */ |
| 24 | qtest_outl(s, 0xcfc, 0xeb); |
| 25 | qtest_outw(s, 0x5d02, 0x205d); |
Philippe Mathieu-Daudé | 6536c9e | 2020-12-01 20:10:23 +0100 | [diff] [blame] | 26 | qtest_quit(s); |
Alexander Bulekov | fd25017 | 2020-11-02 11:33:36 -0500 | [diff] [blame] | 27 | } |
| 28 | |
Li Qiang | d8dd109 | 2020-09-21 09:06:05 -0700 | [diff] [blame] | 29 | int main(int argc, char **argv) |
| 30 | { |
| 31 | const char *arch = qtest_get_arch(); |
| 32 | |
| 33 | g_test_init(&argc, &argv, NULL); |
| 34 | |
| 35 | if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { |
Paolo Bonzini | af05fff | 2021-03-19 04:44:42 -0400 | [diff] [blame] | 36 | qtest_add_func("ich9/test_lp1878642_pci_bus_get_irq_level_assert", |
Alexander Bulekov | fd25017 | 2020-11-02 11:33:36 -0500 | [diff] [blame] | 37 | test_lp1878642_pci_bus_get_irq_level_assert); |
Li Qiang | d8dd109 | 2020-09-21 09:06:05 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | return g_test_run(); |
| 41 | } |