Commit 96e5083a authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

lcd: libfipc builds.

I needed to make the struct fipc_ring_buf a bit bigger -- 2 cache
lines instead of 1. This is because the kernel's struct mutex
can be a little big, depending on the config. If we really want
to make it smaller, we should require the kernel config to be
set a certain way, perhaps.
parent 6365fba7
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
DIST_DIRS = src
DIST_DIRS = src old1 old2
COMMON_SRCS = \
common/ipc.o
COMMON_INCLUDES = include
SUBDIRS = common include $(PLATFORM_DIR)
DIST_SUBDIRS = common include platform
......@@ -57,7 +57,7 @@ get_current_rx_slot(struct fipc_ring_channel *rc)
return &rc->rx.buffer[idx];
}
static inline int check_rx_slot_available(struct ipc_message *slot)
static inline int check_rx_slot_available(struct fipc_message *slot)
{
return (likely(slot->msg_status != FIPC_MSG_STATUS_SENT));
}
......@@ -78,11 +78,11 @@ static inline unsigned long order_two_mask(unsigned int buf_order)
return nr_slots(buf_order) - 1;
}
int fipc_prep_buffers(unsigned int buf_order, void *buffer_1, void *buffer_2);
int fipc_prep_buffers(unsigned int buf_order, void *buffer_1, void *buffer_2)
{
unsigned long i;
struct ipc_message *msg_buffer_1 = buffer_1;
struct ipc_message *msg_buffer_2 = buffer_2;
struct fipc_message *msg_buffer_1 = buffer_1;
struct fipc_message *msg_buffer_2 = buffer_2;
/*
* Buffers must be at least as big as one ipc message slot
*/
......@@ -115,7 +115,7 @@ int fipc_ring_channel_init(struct fipc_ring_channel *chnl,
* Checks at compile time
*/
BUILD_BUG_ON_NOT_POWER_OF_2(FIPC_CACHE_LINE_SIZE);
BUILD_BUG_ON(sizeof(struct fipc_ring_buf) != FIPC_CACHE_LINE_SIZE);
BUILD_BUG_ON(sizeof(struct fipc_ring_buf) != 2 * FIPC_CACHE_LINE_SIZE);
BUILD_BUG_ON(sizeof(struct fipc_message) != FIPC_CACHE_LINE_SIZE);
/*
* Buffers must be as big as one ipc message slot
......
......@@ -55,10 +55,10 @@ struct fipc_message {
* above.)
*
* XXX: This definition may need to be arch-specific in general if we want
* it to be cacheline sized.
* it to be double cacheline sized.
*/
#define FIPC_RING_BUF_PADDING \
(FIPC_CACHE_LINE_SIZE - \
(2 * FIPC_CACHE_LINE_SIZE - \
(3 * sizeof(unsigned long) + sizeof(fipc_mutex_t)))
struct fipc_ring_buf {
/**
......
......@@ -11,7 +11,7 @@
# This single line of magic makes it so we can do an out of src tree
# build. It has to do with how and where this Kbuild file is included
# in the kernel build system.
src = @abs_top_srcdir@/src
src = @abs_top_srcdir@/src/platform/kernel
# Sources that make up library
lib-y += \
......
......@@ -20,6 +20,9 @@ AM_CPPFLAGS = \
-I$(abs_top_builddir)/src/include \
$(KERNEL_INCLUDES)
COMMON_SRCS= \
../../common/ipc.c
# Necessary to export so that these variables are available in Kbuilds
export AM_CPPFLAGS COMMON_SRCS
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment