Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
include/qb/qbipc_common.h | 49 +++++++++++++++++++++++++++++++++++++++++++++
include/qb/qbipcc.h | 1 +
include/qb/qbipcs.h | 2 +-
lib/ipc_int.h | 11 ----------
lib/ipcs.c | 2 +-
5 files changed, 52 insertions(+), 13 deletions(-)
create mode 100644 include/qb/qbipc_common.h
diff --git a/include/qb/qbipc_common.h b/include/qb/qbipc_common.h
new file mode 100644
index 0000000..2d88b5e
--- /dev/null
+++ b/include/qb/qbipc_common.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Angus Salkeld <asalkeld(a)redhat.com>
+ *
+ * This software licensed under BSD license, the text of which follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef QB_IPC_COMMON_H_DEFINED
+#define QB_IPC_COMMON_H_DEFINED
+
+typedef struct {
+ int size __attribute__((aligned(8)));
+ int id __attribute__((aligned(8)));
+} qb_ipc_request_header_t __attribute__((aligned(8)));
+
+typedef struct {
+ int size __attribute__((aligned(8)));
+ int id __attribute__((aligned(8)));
+ int32_t error __attribute__((aligned(8)));
+} qb_ipc_response_header_t __attribute__((aligned(8)));
+
+#endif /* QB_IPC_COMMON_H_DEFINED */
+
diff --git a/include/qb/qbipcc.h b/include/qb/qbipcc.h
index 721afee..f873b59 100644
--- a/include/qb/qbipcc.h
+++ b/include/qb/qbipcc.h
@@ -40,6 +40,7 @@
#include <sys/poll.h>
#include <sys/socket.h>
#include <qb/qbhdb.h>
+#include <qb/qbipc_common.h>
#ifdef __cplusplus
extern "C" {
diff --git a/include/qb/qbipcs.h b/include/qb/qbipcs.h
index 1d7ab32..0500db4 100644
--- a/include/qb/qbipcs.h
+++ b/include/qb/qbipcs.h
@@ -36,7 +36,7 @@
#define QB_IPCS_H_DEFINED
#include <stdlib.h>
-//#include <qb/engine/objdb.h>
+#include <qb/qbipc_common.h>
#ifdef __cplusplus
extern "C" {
diff --git a/lib/ipc_int.h b/lib/ipc_int.h
index ecca917..2ce02c7 100644
--- a/lib/ipc_int.h
+++ b/lib/ipc_int.h
@@ -67,17 +67,6 @@ enum req_init_types {
#define MESSAGE_RES_ENABLE_FLOWCONTROL 2
#define MESSAGE_RES_OUTQ_FLUSH_NR 3
-typedef struct {
- int size __attribute__((aligned(8)));
- int id __attribute__((aligned(8)));
-} qb_ipc_request_header_t __attribute__((aligned(8)));
-
-typedef struct {
- int size __attribute__((aligned(8)));
- int id __attribute__((aligned(8)));
- int32_t error __attribute__((aligned(8)));
-} qb_ipc_response_header_t __attribute__((aligned(8)));
-
struct control_buffer {
unsigned int read;
unsigned int write;
diff --git a/lib/ipcs.c b/lib/ipcs.c
index 70ee812..8ad991d 100644
--- a/lib/ipcs.c
+++ b/lib/ipcs.c
@@ -48,8 +48,8 @@
#include <qb/qblist.h>
#include <qb/qbhdb.h>
-#include "ipc_int.h"
#include <qb/qbipcs.h>
+#include "ipc_int.h"
//#define LOGSYS_UTILS_ONLY 1
#include <syslog.h>
--
1.6.6.1
Show replies by date