[Cbe-oss-dev] [PATCH 02/17]MARS/core: Add explicit pad

Yuji Mano yuji.mano at am.sony.com
Wed Nov 26 14:39:38 EST 2008


From: Kazunori Asayama <asayama at sm.sony.co.jp>

Add explicit pad to shared data

This patch adds explicit pad to shared data to keep binary
compatibility of shared data between various host architectures and/or
ABIs.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>
---
 core/src/common/kernel_internal_types.h   |    3 +++
 core/src/common/workload_internal_types.h |    2 ++
 2 files changed, 5 insertions(+)

--- a/core/src/common/kernel_internal_types.h
+++ b/core/src/common/kernel_internal_types.h
@@ -46,6 +46,7 @@
 #define MARS_KERNEL_TICKS_FLAG_SYNC_BEGIN	0x1
 #define MARS_KERNEL_TICKS_FLAG_SYNC_END		0x2
 #define MARS_KERNEL_PARAMS_ALIGN		128
+#define MARS_KERNEL_PARAMS_SIZE			128
 
 /* mars kernel syscalls */
 struct mars_kernel_syscalls {
@@ -67,9 +68,11 @@ struct mars_kernel_ticks {
 /* mars kernel parameters */
 struct mars_kernel_params {
 	uint32_t kernel_id;
+	uint32_t pad1;
 	uint64_t mars_context_ea;
 	uint64_t workload_queue_ea;
 	struct mars_kernel_ticks kernel_ticks;
+	uint8_t pad2[MARS_KERNEL_PARAMS_SIZE - 32];
 } __attribute__((aligned(MARS_KERNEL_PARAMS_ALIGN)));
 
 /* mars module entry */
--- a/core/src/common/workload_internal_types.h
+++ b/core/src/common/workload_internal_types.h
@@ -66,6 +66,7 @@
 
 #define MARS_WORKLOAD_QUEUE_ALIGN		128	/* align to 128 bytes */
 #define MARS_WORKLOAD_QUEUE_HEADER_ALIGN	128	/* align to 128 bytes */
+#define MARS_WORKLOAD_QUEUE_HEADER_SIZE		128	/* size of 128 bytes */
 #define MARS_WORKLOAD_QUEUE_BLOCK_ALIGN		128	/* align to 128 bytes */
 
 #define MARS_WORKLOAD_QUEUE_FLAG_NONE		0x0	/* no flag set */
@@ -106,6 +107,7 @@ struct mars_workload_queue_header {
 	uint64_t queue_ea;
 	uint64_t context_ea;
 	uint8_t flag;
+	uint8_t pad[MARS_WORKLOAD_QUEUE_HEADER_SIZE - 17];
 } __attribute__((aligned(MARS_WORKLOAD_QUEUE_HEADER_ALIGN)));
 
 /* 128 byte workload queue block structure */






More information about the cbe-oss-dev mailing list