diff mbox

[RFC,v2,07/23] cpu: Prepare Socket container type

Message ID 1427117764-23008-8-git-send-email-bharata@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bharata B Rao March 23, 2015, 1:35 p.m. UTC
From: Andreas Färber <afaerber@suse.de>

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 hw/cpu/Makefile.objs    |  2 +-
 hw/cpu/socket.c         | 21 +++++++++++++++++++++
 include/hw/cpu/socket.h | 14 ++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 hw/cpu/socket.c
 create mode 100644 include/hw/cpu/socket.h

Comments

David Gibson March 25, 2015, 2:03 a.m. UTC | #1
On Mon, Mar 23, 2015 at 07:05:48PM +0530, Bharata B Rao wrote:
> From: Andreas Färber <afaerber@suse.de>

This really wants a commit message explaining the function of this new
abstraction.

> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
>  hw/cpu/Makefile.objs    |  2 +-
>  hw/cpu/socket.c         | 21 +++++++++++++++++++++
>  include/hw/cpu/socket.h | 14 ++++++++++++++
>  3 files changed, 36 insertions(+), 1 deletion(-)
>  create mode 100644 hw/cpu/socket.c
>  create mode 100644 include/hw/cpu/socket.h
> 
> diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs
> index 6381238..e6890cf 100644
> --- a/hw/cpu/Makefile.objs
> +++ b/hw/cpu/Makefile.objs
> @@ -3,4 +3,4 @@ obj-$(CONFIG_REALVIEW) += realview_mpcore.o
>  obj-$(CONFIG_A9MPCORE) += a9mpcore.o
>  obj-$(CONFIG_A15MPCORE) += a15mpcore.o
>  obj-$(CONFIG_ICC_BUS) += icc_bus.o
> -
> +obj-y += socket.o
> diff --git a/hw/cpu/socket.c b/hw/cpu/socket.c
> new file mode 100644
> index 0000000..5ca47e9
> --- /dev/null
> +++ b/hw/cpu/socket.c
> @@ -0,0 +1,21 @@
> +/*
> + * CPU socket abstraction
> + *
> + * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
> + * Copyright (c) 2015 SUSE Linux GmbH
> + */
> +
> +#include "hw/cpu/socket.h"
> +
> +static const TypeInfo cpu_socket_type_info = {
> +    .name = TYPE_CPU_SOCKET,
> +    .parent = TYPE_DEVICE,
> +    .abstract = true,
> +};
> +
> +static void cpu_socket_register_types(void)
> +{
> +    type_register_static(&cpu_socket_type_info);
> +}
> +
> +type_init(cpu_socket_register_types)
> diff --git a/include/hw/cpu/socket.h b/include/hw/cpu/socket.h
> new file mode 100644
> index 0000000..c8e0c18
> --- /dev/null
> +++ b/include/hw/cpu/socket.h
> @@ -0,0 +1,14 @@
> +/*
> + * CPU socket abstraction
> + *
> + * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
> + * Copyright (c) 2015 SUSE Linux GmbH
> + */
> +#ifndef HW_CPU_SOCKET_H
> +#define HW_CPU_SOCKET_H
> +
> +#include "hw/qdev.h"
> +
> +#define TYPE_CPU_SOCKET "cpu-socket"
> +
> +#endif
diff mbox

Patch

diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs
index 6381238..e6890cf 100644
--- a/hw/cpu/Makefile.objs
+++ b/hw/cpu/Makefile.objs
@@ -3,4 +3,4 @@  obj-$(CONFIG_REALVIEW) += realview_mpcore.o
 obj-$(CONFIG_A9MPCORE) += a9mpcore.o
 obj-$(CONFIG_A15MPCORE) += a15mpcore.o
 obj-$(CONFIG_ICC_BUS) += icc_bus.o
-
+obj-y += socket.o
diff --git a/hw/cpu/socket.c b/hw/cpu/socket.c
new file mode 100644
index 0000000..5ca47e9
--- /dev/null
+++ b/hw/cpu/socket.c
@@ -0,0 +1,21 @@ 
+/*
+ * CPU socket abstraction
+ *
+ * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
+ * Copyright (c) 2015 SUSE Linux GmbH
+ */
+
+#include "hw/cpu/socket.h"
+
+static const TypeInfo cpu_socket_type_info = {
+    .name = TYPE_CPU_SOCKET,
+    .parent = TYPE_DEVICE,
+    .abstract = true,
+};
+
+static void cpu_socket_register_types(void)
+{
+    type_register_static(&cpu_socket_type_info);
+}
+
+type_init(cpu_socket_register_types)
diff --git a/include/hw/cpu/socket.h b/include/hw/cpu/socket.h
new file mode 100644
index 0000000..c8e0c18
--- /dev/null
+++ b/include/hw/cpu/socket.h
@@ -0,0 +1,14 @@ 
+/*
+ * CPU socket abstraction
+ *
+ * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
+ * Copyright (c) 2015 SUSE Linux GmbH
+ */
+#ifndef HW_CPU_SOCKET_H
+#define HW_CPU_SOCKET_H
+
+#include "hw/qdev.h"
+
+#define TYPE_CPU_SOCKET "cpu-socket"
+
+#endif