diff --git a/linux/include/_lad.h b/linux/include/_lad.h
index 9489ef370df2039a63a198a2acdc025533e3370d..4bdfd8e38de4b02185ecaa14bc62ecd85ba751d2 100644 (file)
--- a/linux/include/_lad.h
+++ b/linux/include/_lad.h
/*
- * Copyright (c) 2012-2014, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <stdio.h>
#include <ti/ipc/GateMP.h>
#include <_GateMP.h>
+#include <_Ipc.h>
#include <GateHWSpinlock.h>
+#include <sys/time.h>
+#include <ti/ipc/namesrv/_NameServerRemoteRpmsg.h>
extern Bool logFile;
extern FILE *logPtr;
+extern struct timeval start_tv;
-/* macros for writing to log file: */
+/*
+ * Macros for writing to log file.
+ *
+ * For the timestamp prefix, subtract the start time (which is established
+ * when the logFile is opened) so that the massive "since the epoch" value
+ * is not displayed. For this, subtract only the timeval.tv_sec (seconds)
+ * value so we don't have to worry about the "borrow" that results when
+ * start_tv.tv_usec > tv.tv_usec.
+ */
#define LOG0(a) \
- if (logFile == TRUE) { fprintf(logPtr, a); fflush(logPtr); }
+ if (logFile == TRUE) { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fprintf(logPtr, "[%d.%06d] " a, \
+ (unsigned int)(tv.tv_sec - start_tv.tv_sec), \
+ (unsigned int)tv.tv_usec); \
+ fflush(logPtr); \
+ }
#define LOG1(a, b) \
- if (logFile == TRUE) { fprintf(logPtr, a, b); fflush(logPtr); }
+ if (logFile == TRUE) { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fprintf(logPtr, "[%d.%06d] " a, \
+ (unsigned int)(tv.tv_sec - start_tv.tv_sec), \
+ (unsigned int)tv.tv_usec, b); \
+ fflush(logPtr); \
+ }
#define LOG2(a, b, c) \
- if (logFile == TRUE) { fprintf(logPtr, a, b, c); fflush(logPtr); }
+ if (logFile == TRUE) { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fprintf(logPtr, "[%d.%06d] " a, \
+ (unsigned int)(tv.tv_sec - start_tv.tv_sec), \
+ (unsigned int)tv.tv_usec, b, c); \
+ fflush(logPtr); \
+ }
+#define LOG3(a, b, c, d) \
+ if (logFile == TRUE) { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fprintf(logPtr, "[%d.%06d] " a, \
+ (unsigned int)(tv.tv_sec - start_tv.tv_sec), \
+ (unsigned int)tv.tv_usec, b, c, d); \
+ fflush(logPtr); \
+ }
+
+#define LOG4(a, b, c, d, e) \
+ if (logFile == TRUE) { \
+ struct timeval tv; \
+ gettimeofday(&tv, NULL); \
+ fprintf(logPtr, "[%d.%06d] " a, \
+ (unsigned int)(tv.tv_sec - start_tv.tv_sec), \
+ (unsigned int)tv.tv_usec, b, c, d, e); \
+ fflush(logPtr); \
+ }
/* macros for generating verbose output: */
#define PRINTVERBOSE0(a) \
/* LAD commmand FIFO strings: */
#if defined (IPC_BUILDOS_ANDROID)
-#define LAD_COMMANDFIFO "/data/local/tmp/LAD/LADCMDS"
-#define LAD_WORKINGDIR "/data/local/tmp/LAD/"
+#define LAD_COMMANDFIFO "/data/lad/LAD/LADCMDS"
+#define LAD_ROOTDIR "/data/lad/"
+#define LAD_WORKINGDIR "/data/lad/LAD/"
#else
#define LAD_COMMANDFIFO "/tmp/LAD/LADCMDS"
+#define LAD_ROOTDIR "/tmp/"
#define LAD_WORKINGDIR "/tmp/LAD/"
#endif
#define LAD_MESSAGEQCREATEMAXNAMELEN 32
-#define LAD_MAXENTRYNAMELEN 32 /* size limit for LAD NameServer name */
+#define LAD_MAXENTRYNAMELEN MAXNAMEINCHAR /* max for LAD NameServer name */
#define LAD_MAXENTRYVALUELEN 32 /* size limit for LAD NameServer value */
typedef enum {
LAD_CONNECT = 0,
LAD_DISCONNECT,
+ LAD_IPC_GETCONFIG,
LAD_NAMESERVER_SETUP,
LAD_NAMESERVER_DESTROY,
LAD_NAMESERVER_PARAMS_INIT,
LAD_NAMESERVER_GET,
LAD_NAMESERVER_ADDUINT32,
LAD_NAMESERVER_GETUINT32,
+ LAD_NAMESERVER_GETLOCAL,
+ LAD_NAMESERVER_GETLOCALUINT32,
LAD_NAMESERVER_REMOVE,
LAD_NAMESERVER_REMOVEENTRY,
+ LAD_NAMESERVER_ATTACH,
+ LAD_NAMESERVER_DETACH,
LAD_MESSAGEQ_GETCONFIG,
LAD_MESSAGEQ_SETUP,
LAD_MESSAGEQ_DESTROY,
LAD_MESSAGEQ_CREATE,
+ LAD_MESSAGEQ_ANNOUNCE,
LAD_MESSAGEQ_DELETE,
LAD_MESSAGEQ_MSGINIT,
LAD_MULTIPROC_GETCONFIG,
+ LAD_GATEMP_ATTACH,
+ LAD_GATEMP_DETACH,
LAD_GATEMP_START,
LAD_GATEMP_GETNUMRESOURCES,
LAD_GATEMP_GETFREERESOURCE,
Char name[LAD_MAXLENGTHFIFONAME];
Char protocol[LAD_MAXLENGTHPROTOVERS];
} connect;
+ struct {
+ Int procId;
+ Int rprocId;
+ } rprocSetId;
struct {
Char name[LAD_MAXENTRYNAMELEN];
NameServer_Params params;
} create;
struct {
NameServer_Handle handle;
- } delete;
+ } nsdelete;
struct {
NameServer_Handle handle;
Char name[LAD_MAXENTRYNAMELEN];
Char name[LAD_MAXENTRYNAMELEN];
UInt16 procId[MultiProc_MAXPROCESSORS];
} getUInt32;
+ struct {
+ NameServer_Handle handle;
+ Char name[LAD_MAXENTRYNAMELEN];
+ UInt32 len;
+ } getLocal;
+ struct {
+ NameServer_Handle handle;
+ Char name[LAD_MAXENTRYNAMELEN];
+ } getLocalUInt32;
struct {
NameServer_Handle handle;
Char name[LAD_MAXENTRYNAMELEN];
NameServer_Handle handle;
Ptr entryPtr;
} removeEntry;
+ struct {
+ UInt16 procId;
+ } attach;
+ struct {
+ UInt16 procId;
+ } detach;
struct {
MessageQ_Config cfg;
} messageQSetup;
Char name[LAD_MESSAGEQCREATEMAXNAMELEN];
MessageQ_Params params;
} messageQCreate;
+ struct {
+ Char name[LAD_MESSAGEQCREATEMAXNAMELEN];
+ Void *serverHandle;
+ } messageQAnnounce;
struct {
Void *serverHandle;
} messageQDelete;
struct {
Int status;
NameServer_Handle handle;
- } delete;
+ } nsdelete;
struct {
Int status;
NameServer_Handle nameServerHandle;
Int queueId;
Void *serverHandle;
} messageQCreate;
+ struct {
+ Int status;
+ } messageQAnnounce;
struct {
Int status;
} messageQDelete;
Int status;
GateHWSpinlock_Config cfgParams;
} gateHWSpinlockGetConfig;
+ Ipc_Config ipcConfig;
NameServer_Params params;
NameServer_Handle handle;
Ptr entryPtr;