diff options
author | David 'Digit' Turner <digit@android.com> | 2010-05-10 18:37:10 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-05-10 23:26:57 -0700 |
commit | a5d412078b8e7478d81df03710eacc7a21096ba2 (patch) | |
tree | 7b6fb338233657c9885bd94f08dee3aa2973c98f /hw | |
parent | 20894ae3fa98f82da925fbeb72e616eef509758a (diff) | |
download | external_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.zip external_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.tar.gz external_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.tar.bz2 |
Upstream: Replace sys-queue.h with qemu-queue.h
Change-Id: I5c51f54a7fe2ea702420429bbf0c789ed6d8c534
Diffstat (limited to 'hw')
-rw-r--r-- | hw/qdev.c | 16 | ||||
-rw-r--r-- | hw/qdev.h | 10 | ||||
-rw-r--r-- | hw/watchdog.c | 16 | ||||
-rw-r--r-- | hw/watchdog.h | 2 |
4 files changed, 21 insertions, 23 deletions
@@ -98,7 +98,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) t->info->bus_type, bus->type); } dev->parent_bus = bus; - LIST_INSERT_HEAD(&bus->children, dev, sibling); + QLIST_INSERT_HEAD(&bus->children, dev, sibling); return dev; } @@ -113,8 +113,8 @@ void qdev_init(DeviceState *dev) /* Unlink device from bus and free the structure. */ void qdev_free(DeviceState *dev) { - LIST_REMOVE(dev, sibling); - free(dev); + QLIST_REMOVE(dev, sibling); + qemu_free(dev); } static DeviceProperty *create_prop(DeviceState *dev, const char *name, @@ -293,7 +293,7 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name) { BusState *bus; - LIST_FOREACH(bus, &dev->child_bus, sibling) { + QLIST_FOREACH(bus, &dev->child_bus, sibling) { if (strcmp(name, bus->name) == 0) { return bus; } @@ -329,9 +329,9 @@ BusState *qbus_create(BusType type, size_t size, bus->type = type; bus->parent = parent; bus->name = qemu_strdup(name); - LIST_INIT(&bus->children); + QLIST_INIT(&bus->children); if (parent) { - LIST_INSERT_HEAD(&parent->child_bus, bus, sibling); + QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling); } return bus; } @@ -384,7 +384,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent) default: break; } - LIST_FOREACH(child, &dev->child_bus, sibling) { + QLIST_FOREACH(child, &dev->child_bus, sibling) { qbus_print(mon, child, indent); } } @@ -396,7 +396,7 @@ static void qbus_print(Monitor *mon, BusState *bus, int indent) qdev_printf("bus: %s\n", bus->name); indent += 2; qdev_printf("type %s\n", bus_type_names[bus->type]); - LIST_FOREACH(dev, &bus->children, sibling) { + QLIST_FOREACH(dev, &bus->children, sibling) { qdev_print(mon, dev, indent); } } @@ -2,7 +2,7 @@ #define QDEV_H #include "hw.h" -#include "sys-queue.h" +#include "qemu-queue.h" typedef struct DeviceType DeviceType; @@ -20,9 +20,9 @@ struct DeviceState { qemu_irq *gpio_out; int num_gpio_in; qemu_irq *gpio_in; - LIST_HEAD(, BusState) child_bus; + QLIST_HEAD(, BusState) child_bus; NICInfo *nd; - LIST_ENTRY(DeviceState) sibling; + QLIST_ENTRY(DeviceState) sibling; }; typedef enum { @@ -37,8 +37,8 @@ struct BusState { DeviceState *parent; const char *name; BusType type; - LIST_HEAD(, DeviceState) children; - LIST_ENTRY(BusState) sibling; + QLIST_HEAD(, DeviceState) children; + QLIST_ENTRY(BusState) sibling; }; /*** Board API. This should go away once we have a machine config file. ***/ diff --git a/hw/watchdog.c b/hw/watchdog.c index 9a28621..27cd16f 100644 --- a/hw/watchdog.c +++ b/hw/watchdog.c @@ -14,23 +14,21 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * along with this program; if not, see <http://www.gnu.org/licenses/>. * * By Richard W.M. Jones (rjones@redhat.com). */ #include "qemu-common.h" -#include "sys-queue.h" +#include "qemu-queue.h" #include "sysemu.h" #include "hw/watchdog.h" -static LIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list; +static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list; void watchdog_add_model(WatchdogTimerModel *model) { - LIST_INSERT_HEAD(&watchdog_list, model, entry); + QLIST_INSERT_HEAD(&watchdog_list, model, entry); } /* Returns: @@ -50,14 +48,14 @@ int select_watchdog(const char *p) /* -watchdog ? lists available devices and exits cleanly. */ if (strcmp(p, "?") == 0) { - LIST_FOREACH(model, &watchdog_list, entry) { + QLIST_FOREACH(model, &watchdog_list, entry) { fprintf(stderr, "\t%s\t%s\n", model->wdt_name, model->wdt_description); } return 2; } - LIST_FOREACH(model, &watchdog_list, entry) { + QLIST_FOREACH(model, &watchdog_list, entry) { if (strcasecmp(model->wdt_name, p) == 0) { watchdog = model; return 0; @@ -65,7 +63,7 @@ int select_watchdog(const char *p) } fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n"); - LIST_FOREACH(model, &watchdog_list, entry) { + QLIST_FOREACH(model, &watchdog_list, entry) { fprintf(stderr, "\t%s\t%s\n", model->wdt_name, model->wdt_description); } diff --git a/hw/watchdog.h b/hw/watchdog.h index c2b2b36..77b9965 100644 --- a/hw/watchdog.h +++ b/hw/watchdog.h @@ -36,7 +36,7 @@ extern void wdt_ib700_init(void); #define WDT_NONE 6 /* Do nothing. */ struct WatchdogTimerModel { - LIST_ENTRY(WatchdogTimerModel) entry; + QLIST_ENTRY(WatchdogTimerModel) entry; /* Short name of the device - used to select it on the command line. */ const char *wdt_name; |