debugexit.c (47b5264eb3e1cd2825e48d28fd0d1b239ed53974) debugexit.c (db895a1e6a97e919f9b86d60c969377357b05066)
1/*
2 * debug exit port emulation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 or
7 * (at your option) any later version.
8 */

--- 21 unchanged lines hidden (view full) ---

30
31static const MemoryRegionOps debug_exit_ops = {
32 .write = debug_exit_write,
33 .valid.min_access_size = 1,
34 .valid.max_access_size = 4,
35 .endianness = DEVICE_LITTLE_ENDIAN,
36};
37
1/*
2 * debug exit port emulation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 or
7 * (at your option) any later version.
8 */

--- 21 unchanged lines hidden (view full) ---

30
31static const MemoryRegionOps debug_exit_ops = {
32 .write = debug_exit_write,
33 .valid.min_access_size = 1,
34 .valid.max_access_size = 4,
35 .endianness = DEVICE_LITTLE_ENDIAN,
36};
37
38static int debug_exit_initfn(ISADevice *dev)
38static void debug_exit_realizefn(DeviceState *d, Error **errp)
39{
39{
40 ISADebugExitState *isa = ISA_DEBUG_EXIT_DEVICE(dev);
40 ISADevice *dev = ISA_DEVICE(d);
41 ISADebugExitState *isa = ISA_DEBUG_EXIT_DEVICE(d);
41
42 memory_region_init_io(&isa->io, &debug_exit_ops, isa,
43 TYPE_ISA_DEBUG_EXIT_DEVICE, isa->iosize);
44 memory_region_add_subregion(isa_address_space_io(dev),
45 isa->iobase, &isa->io);
42
43 memory_region_init_io(&isa->io, &debug_exit_ops, isa,
44 TYPE_ISA_DEBUG_EXIT_DEVICE, isa->iosize);
45 memory_region_add_subregion(isa_address_space_io(dev),
46 isa->iobase, &isa->io);
46 return 0;
47}
48
49static Property debug_exit_properties[] = {
50 DEFINE_PROP_HEX32("iobase", ISADebugExitState, iobase, 0x501),
51 DEFINE_PROP_HEX32("iosize", ISADebugExitState, iosize, 0x02),
52 DEFINE_PROP_END_OF_LIST(),
53};
54
55static void debug_exit_class_initfn(ObjectClass *klass, void *data)
56{
57 DeviceClass *dc = DEVICE_CLASS(klass);
47}
48
49static Property debug_exit_properties[] = {
50 DEFINE_PROP_HEX32("iobase", ISADebugExitState, iobase, 0x501),
51 DEFINE_PROP_HEX32("iosize", ISADebugExitState, iosize, 0x02),
52 DEFINE_PROP_END_OF_LIST(),
53};
54
55static void debug_exit_class_initfn(ObjectClass *klass, void *data)
56{
57 DeviceClass *dc = DEVICE_CLASS(klass);
58 ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
59 ic->init = debug_exit_initfn;
58
59 dc->realize = debug_exit_realizefn;
60 dc->props = debug_exit_properties;
61}
62
63static const TypeInfo debug_exit_info = {
64 .name = TYPE_ISA_DEBUG_EXIT_DEVICE,
65 .parent = TYPE_ISA_DEVICE,
66 .instance_size = sizeof(ISADebugExitState),
67 .class_init = debug_exit_class_initfn,
68};
69
70static void debug_exit_register_types(void)
71{
72 type_register_static(&debug_exit_info);
73}
74
75type_init(debug_exit_register_types)
60 dc->props = debug_exit_properties;
61}
62
63static const TypeInfo debug_exit_info = {
64 .name = TYPE_ISA_DEBUG_EXIT_DEVICE,
65 .parent = TYPE_ISA_DEVICE,
66 .instance_size = sizeof(ISADebugExitState),
67 .class_init = debug_exit_class_initfn,
68};
69
70static void debug_exit_register_types(void)
71{
72 type_register_static(&debug_exit_info);
73}
74
75type_init(debug_exit_register_types)