+2006-11-09 Martin Hunt <hunt@redhat.com>
+
+ * transport_msgs.h: Change all ints to int32_t. Prefix
+ all struct names with "_stp".
+ * transport.c: Use new struct names.
+ (_stp_handle_start): Send pointer size and endianess.
+ * procfs.c: Use new struct names.
+
2006-11-02 Martin Hunt <hunt@redhat.com>
* symbols.c (_stp_do_module): Fix error message.
switch (type) {
case STP_START:
{
- struct transport_start st;
- if (count < sizeof(struct transport_start))
+ struct _stp_transport_start st;
+ if (count < sizeof(struct _stp_transport_start))
return 0;
- if (copy_from_user (&st, buf, sizeof(struct transport_start)))
+ if (copy_from_user (&st, buf, sizeof(struct _stp_transport_start)))
return -EFAULT;
_stp_handle_start (&st);
break;
break;
case STP_TRANSPORT_INFO:
{
- struct transport_info ti;
- kbug("STP_TRANSPORT_INFO %d %d\n", (int)count, (int)sizeof(struct transport_info));
- if (count < sizeof(struct transport_info))
+ struct _stp_transport_info ti;
+ kbug("STP_TRANSPORT_INFO %d %d\n", (int)count, (int)sizeof(struct _stp_transport_info));
+ if (count < sizeof(struct _stp_transport_info))
return 0;
- if (copy_from_user (&ti, buf, sizeof(struct transport_info)))
+ if (copy_from_user (&ti, buf, sizeof(struct _stp_transport_info)))
return -EFAULT;
if (_stp_transport_open (&ti) < 0)
return -1;
void probe_exit(void);
int probe_start(void);
void _stp_exit(void);
-void _stp_handle_start (struct transport_start *st);
+void _stp_handle_start (struct _stp_transport_start *st);
static void _stp_work_queue (void *data);
static DECLARE_WORK(stp_exit, _stp_work_queue, NULL);
static struct workqueue_struct *_stp_wq;
-int _stp_transport_open(struct transport_info *info);
+int _stp_transport_open(struct _stp_transport_info *info);
#include "procfs.c"
#ifdef STP_RELAYFS
static void _stp_handle_buf_info(int *cpuptr)
{
- struct buf_info out;
+ struct _stp_buf_info out;
out.cpu = *cpuptr;
#if (RELAYFS_CHANNEL_VERSION >= 4) || defined (CONFIG_RELAY)
* _stp_handle_start - handle STP_START
*/
-void _stp_handle_start (struct transport_start *st)
+void _stp_handle_start (struct _stp_transport_start *st)
{
#ifdef CONFIG_MODULES
static int got_modules=0;
/* we've got a start request, but first, grab kernel symbols if we need them */
if (_stp_num_modules == 0) {
- char tmp = 0;
- _stp_transport_send(STP_SYMBOLS, &tmp, 1);
+ struct _stp_symbol_req req;
+ req.endian = 0x1234;
+ req.ptr_size = sizeof(char *);
+ _stp_transport_send(STP_SYMBOLS, &req, sizeof(req));
return;
}
/**
* _stp_handle_subbufs_consumed - handle STP_SUBBUFS_CONSUMED
*/
-static void _stp_handle_subbufs_consumed(int pid, struct consumed_info *info)
+static void _stp_handle_subbufs_consumed(int pid, struct _stp_consumed_info *info)
{
relay_subbufs_consumed(_stp_chan, info->cpu, info->consumed);
}
* containing the final parameters used.
*/
-int _stp_transport_open(struct transport_info *info)
+int _stp_transport_open(struct _stp_transport_info *info)
{
kbug ("stp_transport_open: %d Mb buffer. target=%d\n", info->buf_size, info->target);
};
/* control channel command structs */
-struct buf_info
+struct _stp_buf_info
{
- int cpu;
- unsigned produced;
- unsigned consumed;
- int flushing;
+ int32_t cpu;
+ uint32_t produced;
+ uint32_t consumed;
+ int32_t flushing;
};
-struct consumed_info
+struct _stp_consumed_info
{
- int cpu;
- unsigned consumed;
+ int32_t cpu;
+ uint32_t consumed;
};
-struct transport_info
+struct _stp_transport_info
{
- unsigned buf_size;
- unsigned subbuf_size;
- unsigned n_subbufs;
- int transport_mode;
- int merge; // merge relayfs output?
- int target; // target pid
+ uint32_t buf_size;
+ uint32_t subbuf_size;
+ uint32_t n_subbufs;
+ int32_t transport_mode;
+ int32_t merge; // merge relayfs output?
+ int32_t target; // target pid
#if 0
char cmd[256]; // cmd to process data
#endif
};
-struct transport_start
+struct _stp_transport_start
{
- int pid; // pid for streaming data
+ int32_t pid; // pid for streaming data
};
-struct cmd_info
+struct _stp_cmd_info
{
char cmd[128];
};
+struct _stp_symbol_req
+{
+ int32_t endian;
+ int32_t ptr_size;
+};