summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorSimon Que <sque@ti.com>2010-03-22 17:07:32 -0600
committerHari Kanigeri <h-kanigeri2@ti.com>2010-07-09 17:57:34 -0500
commitaaf382e79ae3bcbd43cf8bffe4bec2f6137c2a3c (patch)
tree0fa820d16b5ca86ce28ae906a29100467e618eec /arch/arm
parent875ec31aad9c7464a65aa04baed0a32bf10b714d (diff)
SYSLINK: ipc - updated gatepeterson for SysLink 2.0
Updated gatepeterson module for SysLink 2.0. GatePeterson ioctl files are obsolete and have been removed as part of the SysLink 2.0 migration. This module no longer has a user-side ioctl interface, and hence these files are not needed. TODO: Need description of other changes Signed-off-by: Simon Que <sque@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-omap/include/syslink/gatepeterson.h83
-rw-r--r--arch/arm/plat-omap/include/syslink/gatepeterson_ioctl.h193
2 files changed, 28 insertions, 248 deletions
diff --git a/arch/arm/plat-omap/include/syslink/gatepeterson.h b/arch/arm/plat-omap/include/syslink/gatepeterson.h
index f2e3f78bf146..461ebe06f193 100644
--- a/arch/arm/plat-omap/include/syslink/gatepeterson.h
+++ b/arch/arm/plat-omap/include/syslink/gatepeterson.h
@@ -21,6 +21,8 @@
#include <linux/types.h>
+#include <igatempsupport.h>
+
/*
* GATEPETERSON_MODULEID
* Unique module ID
@@ -32,12 +34,12 @@
* single processor gates used for local protection
*/
enum gatepeterson_protect {
- GATEPETERSON_PROTECT_DEFAULT = 0,
- GATEPETERSON_PROTECT_NONE = 1,
- GATEPETERSON_PROTECT_INTERRUPT = 2,
- GATEPETERSON_PROTECT_TASKLET = 3,
- GATEPETERSON_PROTECT_THREAD = 4,
- GATEPETERSON_PROTECT_PROCESS = 5,
+ GATEPETERSON_PROTECT_DEFAULT = 0,
+ GATEPETERSON_PROTECT_NONE = 1,
+ GATEPETERSON_PROTECT_INTERRUPT = 2,
+ GATEPETERSON_PROTECT_TASKLET = 3,
+ GATEPETERSON_PROTECT_THREAD = 4,
+ GATEPETERSON_PROTECT_PROCESS = 5,
GATEPETERSON_PROTECT_END_VALUE = 6
};
@@ -55,13 +57,9 @@ struct gatepeterson_config {
* in which enter and leave are to be called,as well as the maximum level
* of protection needed locally.
*/
- u32 max_name_len; /* GP name len */
- bool use_nameserver;
- /*!< Whether to have this module use the NameServer or not. If the
- * NameServer is not needed, set this configuration parameter to false.
- * This informs GatePeterson not to pull in the NameServer module.
- * In this case, all names passed into create and open are ignored.
- */
+ u32 num_instances;
+ /*!< Maximum number of instances supported by the GatePeterson module */
+
};
/*
@@ -69,35 +67,7 @@ struct gatepeterson_config {
* instances
*/
struct gatepeterson_params {
- void *shared_addr;
- /* Address of the shared memory. The creator must supply a cache-aligned
- * address in shared memory that will be used to store shared state
- * information.
- */
-
- u32 shared_addr_size;
- /* Size of the shared memory region. Can use gatepeterson_shared_memreq
- * call to determine the required size.
- */
-
- char *name;
- /* If using nameserver, name of this instance. The name (if not NULL) must
- * be unique among all gatepeterson instances in the entire system.
- */
-
- enum gatepeterson_protect local_protection;
- /* Local gate protection level. The default value, (Protect_DEFAULT)
- * results in inheritance from module-level defaultProtection. This
- * instance setting should be set to an alternative only if a different
- * local protection level is needed for the instance.
- */
- bool use_nameserver;
- /* Whether to have this module use the nameserver or not. If the
- * nameserver is not needed, set this configuration parameter to
- * false.This informs gatepeterson not to pull in the nameaerver
- * module. In this case, all names passed into create and open are
- * ignored.
- */
+ IGATEMPSUPPORT_SUPERPARAMS;
};
/*
@@ -118,13 +88,13 @@ int gatepeterson_destroy(void);
/*
* Function to initialize the parameter structure
*/
-void gatepeterson_params_init(void *handle,
- struct gatepeterson_params *params);
+void gatepeterson_params_init(struct gatepeterson_params *params);
/*
* Function to create an instance of GatePeterson
*/
-void *gatepeterson_create(const struct gatepeterson_params *params);
+void *gatepeterson_create(enum igatempsupport_local_protect local_protect,
+ const struct gatepeterson_params *params);
/*
* Function to delete an instance of GatePeterson
@@ -132,10 +102,10 @@ void *gatepeterson_create(const struct gatepeterson_params *params);
int gatepeterson_delete(void **gphandle);
/*
- * Function to open a previously created instance
+ * Function to open a previously created instance by address
*/
-int gatepeterson_open(void **gphandle,
- struct gatepeterson_params *params);
+int gatepeterson_open_by_addr(enum igatempsupport_local_protect local_protect,
+ void *shared_addr, void **gphandle);
/*
* Function to close a previously opened instance
@@ -145,23 +115,26 @@ int gatepeterson_close(void **gphandle);
/*
* Function to enter the gate peterson
*/
-u32 gatepeterson_enter(void *gphandle);
+int *gatepeterson_enter(void *gphandle);
/*
*Function to leave the gate peterson
*/
-void gatepeterson_leave(void *gphandle, u32 flag);
+void gatepeterson_leave(void *gphandle, int *key);
+/*
+ * Function to return the shared memory requirement
+ */
+u32 gatepeterson_shared_mem_req(const struct gatepeterson_params *params);
/*
- * Returns the gatepeterson kernel object pointer
+ * Function to return the number of instances configured in the module.
*/
-void *gatepeterson_get_knl_handle(void **gpHandle);
+u32 gatepeterson_get_num_instances(void);
/*
- * Function to return the shared memory requirement
+ * Function to initialize the locks module.
*/
-u32 gatepeterson_shared_memreq(const struct gatepeterson_params *params);
+void gatepeterson_locks_init(void);
#endif /* _GATEPETERSON_H_ */
-
diff --git a/arch/arm/plat-omap/include/syslink/gatepeterson_ioctl.h b/arch/arm/plat-omap/include/syslink/gatepeterson_ioctl.h
deleted file mode 100644
index ed7ab86b75bc..000000000000
--- a/arch/arm/plat-omap/include/syslink/gatepeterson_ioctl.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * gatepeterson_ioctl.h
- *
- * The Gate Peterson Algorithm for mutual exclusion of shared memory.
- * Current implementation works for 2 processors.
- *
- * Copyright (C) 2008-2009 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-#ifndef _GATEPETERSON_IOCTL_
-#define _GATEPETERSON_IOCTL_
-
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-#include <ipc_ioctl.h>
-#include <gatepeterson.h>
-
-enum CMD_GATEPETERSON {
- GATEPETERSON_GETCONFIG = GATEPETERSON_BASE_CMD,
- GATEPETERSON_SETUP,
- GATEPETERSON_DESTROY,
- GATEPETERSON_PARAMS_INIT,
- GATEPETERSON_CREATE,
- GATEPETERSON_DELETE,
- GATEPETERSON_OPEN,
- GATEPETERSON_CLOSE,
- GATEPETERSON_ENTER,
- GATEPETERSON_LEAVE,
- GATEPETERSON_SHAREDMEMREQ
-};
-
-/*
- * IOCTL command IDs for gatepeterson
- */
-
-/*
- * Command for gatepeterson_get_config
- */
-#define CMD_GATEPETERSON_GETCONFIG _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_GETCONFIG, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_setup
- */
-#define CMD_GATEPETERSON_SETUP _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_SETUP, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_setup
- */
-#define CMD_GATEPETERSON_DESTROY _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_DESTROY, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_destroy
- */
-#define CMD_GATEPETERSON_PARAMS_INIT _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_PARAMS_INIT, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_create
- */
-#define CMD_GATEPETERSON_CREATE _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_CREATE, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_delete
- */
-#define CMD_GATEPETERSON_DELETE _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_DELETE, \
- struct gatepeterson_cmd_args)
-/*
- * Command for gatepeterson_open
- */
-#define CMD_GATEPETERSON_OPEN _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_OPEN, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_close
- */
-#define CMD_GATEPETERSON_CLOSE _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_CLOSE, \
- struct gatepeterson_cmd_args)
-/*
- * Command for gatepeterson_enter
- */
-#define CMD_GATEPETERSON_ENTER _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_ENTER, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_leave
- */
-#define CMD_GATEPETERSON_LEAVE _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_LEAVE, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command for gatepeterson_shared_memreq
- */
-#define CMD_GATEPETERSON_SHAREDMEMREQ _IOWR(IPC_IOC_MAGIC, \
- GATEPETERSON_SHAREDMEMREQ, \
- struct gatepeterson_cmd_args)
-
-/*
- * Command arguments for gatepeterson
- */
-union gatepeterson_arg {
- struct {
- void *handle;
- struct gatepeterson_params *params;
- } params_init;
-
- struct {
- struct gatepeterson_config *config;
- } get_config;
-
- struct {
- struct gatepeterson_config *config;
- } setup;
-
- struct {
- void *handle;
- struct gatepeterson_params *params;
- u32 name_len;
- u32 shared_addr_srptr;
- } create;
-
- struct {
- void *handle;
- } delete;
-
- struct {
- void *handle;
- struct gatepeterson_params *params;
- u32 name_len;
- u32 shared_addr_srptr;
- } open;
-
- struct {
- void *handle;
- } close;
-
- struct {
- void *handle;
- u32 flags;
- } enter;
-
- struct {
- void *handle;
- u32 flags;
- } leave;
-
- struct {
- void *handle;
- struct gatepeterson_params *params;
- u32 bytes;
- } shared_memreq;
-
-};
-
-/*
- * Command arguments for gatepeterson
- */
-struct gatepeterson_cmd_args {
- union gatepeterson_arg args;
- s32 api_status;
-};
-
-/*
- * This ioctl interface for gatepeterson module
- */
-int gatepeterson_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long args);
-
-#endif /* _GATEPETERSON_IOCTL_ */
-