Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
4179e7b2
Commit
4179e7b2
authored
Dec 29, 2019
by
Stephanie Gawroriski
Browse files
Forward IPC calls in Java SE.
parent
e5f5f4fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
bldt/javase/libs/javase-runtime/cc/squirreljme/jvm/Assembly.java
View file @
4179e7b2
...
...
@@ -1958,7 +1958,23 @@ public final class Assembly
// IPC Call
case
SystemCallIndex
.
IPC_CALL
:
throw
new
todo
.
TODO
();
try
{
return
IPCManager
.
ipcCall
(
0
,
__args
);
}
catch
(
RuntimeException
e
)
{
// Debug this
e
.
printStackTrace
();
// Store class name caught
__data
.
exception
=
Assembly
.
__uniqueStringId
(
e
.
getClass
().
getName
().
replace
(
'.'
,
'/'
));
// Fail
throw
new
SystemCallException
(
SystemCallError
.
IPC_ERROR
);
}
// Loads a string
case
SystemCallIndex
.
LOAD_STRING
:
...
...
ratufacoat/sjmecon.h
View file @
4179e7b2
...
...
@@ -529,6 +529,9 @@ extern "C"
/** End of file. */
#define SJME_SYSCALL_ERROR_END_OF_FILE SJME_JINT_C(-9)
/** IPC Error. */
#define SJME_SYSCALL_ERROR_IPC_ERROR SJME_JINT_C(-10)
/*****************************************************************************
***************************** PIPE DESCRIPTORS *******************************
*****************************************************************************/
...
...
runt/apis/cldc-compact/cc/squirreljme/jvm/IPCManager.java
View file @
4179e7b2
...
...
@@ -70,6 +70,65 @@ public final class IPCManager
__g
,
__h
);
}
/**
* This is the handler for IPC messages, which performs unfolding
* accordingly.
*
* @param __tid The origin task ID.
* @param __v Input values.
* @return The result of the IPC call.
* @throws NullPointerException On null arguments.
* @since 2019/12/28
*/
public
static
final
long
ipcCall
(
int
__tid
,
int
...
__v
)
throws
NullPointerException
{
if
(
__v
==
null
)
throw
new
NullPointerException
(
"NARG"
);
int
n
=
__v
.
length
;
return
IPCManager
.
ipcCall
(
__tid
,
(
0
<
n
?
__v
[
0
]
:
0
),
(
1
<
n
?
__v
[
1
]
:
0
),
(
2
<
n
?
__v
[
2
]
:
0
),
(
3
<
n
?
__v
[
3
]
:
0
),
(
4
<
n
?
__v
[
4
]
:
0
),
(
5
<
n
?
__v
[
5
]
:
0
),
(
6
<
n
?
__v
[
6
]
:
0
),
(
7
<
n
?
__v
[
7
]
:
0
),
(
8
<
n
?
__v
[
8
]
:
0
));
}
/**
* This is the handler for IPC messages, which performs unfolding
* accordingly.
*
* @param __tid The origin task ID.
* @param __ipcid The ID number of the IPC interface.
* @param __v Input values.
* @return The result of the IPC call.
* @throws NullPointerException On null arguments.
* @since 2019/12/28
*/
public
static
final
long
ipcCall
(
int
__tid
,
int
__ipcid
,
int
...
__v
)
throws
NullPointerException
{
if
(
__v
==
null
)
throw
new
NullPointerException
(
"NARG"
);
int
n
=
__v
.
length
;
return
IPCManager
.
ipcCall
(
__tid
,
__ipcid
,
(
0
<
n
?
__v
[
0
]
:
0
),
(
1
<
n
?
__v
[
1
]
:
0
),
(
2
<
n
?
__v
[
2
]
:
0
),
(
3
<
n
?
__v
[
3
]
:
0
),
(
4
<
n
?
__v
[
4
]
:
0
),
(
5
<
n
?
__v
[
5
]
:
0
),
(
6
<
n
?
__v
[
6
]
:
0
),
(
7
<
n
?
__v
[
7
]
:
0
));
}
/**
* Registers the given ID with the specified callback.
*
...
...
runt/apis/cldc-compact/cc/squirreljme/jvm/SystemCallError.java
View file @
4179e7b2
...
...
@@ -56,6 +56,10 @@ public final class SystemCallError
public
static
final
byte
END_OF_FILE
=
-
9
;
/** Error with IPC Call. */
public
static
final
byte
IPC_ERROR
=
-
10
;
/**
* Not used.
*
...
...
runt/klib/supervisor/cc/squirreljme/jvm/SystemCallError.java
View file @
4179e7b2
...
...
@@ -56,6 +56,10 @@ public final class SystemCallError
public
static
final
byte
END_OF_FILE
=
-
9
;
/** Error with IPC Call. */
public
static
final
byte
IPC_ERROR
=
-
10
;
/**
* Not used.
*
...
...
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