Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
c4f7247f
Commit
c4f7247f
authored
Apr 25, 2012
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
Jul 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt: removed obsolete RPC test function
parent
da34c2ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
87 deletions
+0
-87
ipc_test.c
rt/ipc_test.c
+0
-87
No files found.
rt/ipc_test.c
deleted
100644 → 0
View file @
da34c2ff
/*
* Mini-ipc: an example freestanding server, based in memory
*
* Copyright (C) 2011,2012 CERN (www.cern.ch)
* Author: Alessandro Rubini <rubini@gnudd.com>
*
* This code is copied from trivial-server, and made even more trivial
*/
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include "minipc.h"
/* A function that ignores the RPC and is written normally */
static
int
ss_do_sum
(
int
a
,
int
b
)
{
return
a
+
b
;
}
/* The following ones are RPC-aware */
static
int
ss_sum_function
(
const
struct
minipc_pd
*
pd
,
uint32_t
*
args
,
void
*
ret
)
{
int
i
;
i
=
ss_do_sum
(
args
[
0
],
args
[
1
]);
*
(
int
*
)
ret
=
i
;
return
0
;
}
static
int
ss_mul_function
(
const
struct
minipc_pd
*
pd
,
uint32_t
*
args
,
void
*
ret
)
{
int
a
,
b
;
a
=
*
(
int
*
)
args
;
b
=
*
(
int
*
)(
args
+
1
);
*
(
int
*
)
ret
=
a
*
b
;
return
0
;
}
/* Describe the two functions above */
const
struct
minipc_pd
ss_sum_struct
=
{
.
f
=
ss_sum_function
,
.
name
=
"sum"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
,
},
};
const
struct
minipc_pd
ss_mul_struct
=
{
.
f
=
ss_mul_function
,
.
name
=
"mul"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
,
},
};
/* The mailbox is mapped at 0x3000 in the linker script */
static
__attribute__
((
section
(
".mbox"
)))
_mailbox
[
1024
];
int
ipc_test
()
{
struct
minipc_ch
*
server
;
// char str[];
server
=
minipc_server_create
(
"mem:3000"
,
0
);
if
(
!
server
)
return
1
;
minipc_export
(
server
,
&
ss_sum_struct
);
minipc_export
(
server
,
&
ss_mul_struct
);
while
(
1
)
{
/* do something else... */
mprintf
(
"."
);
minipc_server_action
(
server
,
1000
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment