Skip to content

Commit

Permalink
Update sources to the latest Genode source.
Browse files Browse the repository at this point in the history
  • Loading branch information
valerius2k committed Jun 10, 2023
1 parent 736fddf commit f8c09ba
Show file tree
Hide file tree
Showing 59 changed files with 199 additions and 93 deletions.
5 changes: 2 additions & 3 deletions platform/genode/include/cpi_session/connection.h
Expand Up @@ -8,11 +8,10 @@ namespace OS2::Cpi { struct Connection; }

struct OS2::Cpi::Connection : Genode::Connection<Session>, Session_client
{
Connection(Genode::Env &env, char const *label)
Connection(Genode::Env &env, Label const &label = Label())
:
/* create session */
Genode::Connection<OS2::Cpi::Session>(env, session(env.parent(),
"ram_quota=6K, cap_quota=4, label=\"%s\"", label)),
Genode::Connection<OS2::Cpi::Session>(env, label, Ram_quota { 6 * 1024 }, Args()),
/* initialize RPC interface */
Session_client(cap()) { }
};
Expand Down
4 changes: 2 additions & 2 deletions platform/genode/include/genode_env.h
Expand Up @@ -5,8 +5,8 @@
#include <base/allocator.h>
#include <base/component.h>

extern "C" Genode::Env *env_ptr;
extern "C" Genode::Allocator *alloc_ptr;
extern Genode::Env *env_ptr;
extern Genode::Allocator *alloc_ptr;

inline Genode::Env &genode_env()
{
Expand Down
2 changes: 1 addition & 1 deletion platform/genode/lib/mk/lx.mk
Expand Up @@ -2,7 +2,7 @@ include $(REP_DIR)/mk/osfree.mk

CC_CXX_WARN_STRICT =
SHARED_LIB = yes
SRC_C = debug.c fixup.c load.c \
SRC_C = debug.c fixup.c load.c unpack.c \
loadobj.c lx.c mod.c allocmem.c
LIBS = base libc compat

Expand Down
1 change: 1 addition & 0 deletions platform/genode/lib/symbols/compat
@@ -1,3 +1,4 @@
CompatInitEnv T
CfgCleanup T
CfgGetenv T
CfgInitOptions T
Expand Down
1 change: 1 addition & 0 deletions platform/genode/lib/symbols/os2app
@@ -1 +1,2 @@
AppClientInitEnv T
AppClientNotify T
1 change: 1 addition & 0 deletions platform/genode/lib/symbols/os2exec
Expand Up @@ -8,6 +8,7 @@ ExcClientGetSect T
ExcClientGetSharedMem T
ExcClientIncrementSharedMemRefcnt T
ExcClientInit T
ExcClientInitEnv T
ExcClientLoad T
ExcClientMapDataspace T
ExcClientOpen T
Expand Down
1 change: 1 addition & 0 deletions platform/genode/lib/symbols/os2fs
Expand Up @@ -10,6 +10,7 @@ FSClientFindNext T
FSClientForceDelete T
FSClientGetDriveMap T
FSClientInit T
FSClientInitEnv T
FSClientOpenL T
FSClientQueryFHState T
FSClientQueryFileInfo T
Expand Down
1 change: 1 addition & 0 deletions platform/genode/lib/symbols/os2srv
Expand Up @@ -17,6 +17,7 @@ CPClientGetPIB T
CPClientGetPID T
CPClientGetTIB T
CPClientInit T
CPClientInitEnv T
CPClientNewTIB T
CPClientOpenEventSem T
CPClientQueryCp T
Expand Down
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/compat/hash
@@ -1 +1 @@
2022-10-23 5deace25694f08b7de1ba9ce2c163fdbc4a3cd1c
2023-06-09 dfc881396d5bee353eb5589e54236b4dbb52b764
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/cpi/hash
@@ -1 +1 @@
2019-03-10 6cb0523eb205232a82130fe5c0aca93ee759d6b0
2023-06-09 8ecf4da4e876fe00f51239ddccb89a5547eb7a25
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/os2app/hash
@@ -1 +1 @@
2019-03-10-i a92ab5871b85269a85eba32a3d32e341fe47960e
2023-06-09 11f3c8f761d52ca8808df16676c0b82b99d63df8
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/os2exec/hash
@@ -1 +1 @@
2019-03-10-a 6f06d5d18a339acecf470368cbb1625b0a17cdfc
2023-06-09 f9ec513d4eba39d69caeb60b14fc1a40425e41b1
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/os2fs/hash
@@ -1 +1 @@
2019-03-10-b 4349346ce794a3def89b80a5e35e6fec72fe9967
2023-06-09 cb19d0e79f64ddccce07f42215f799c047784ff6
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/os2srv/hash
@@ -1 +1 @@
2019-03-10-d 52d3c6071963e66ea3d45b2c757d8d3aef9b0ebe
2023-06-09 42b52fb3e61e102d879e3e2a6cc18aa2ea06384c
2 changes: 1 addition & 1 deletion platform/genode/recipes/api/os3/hash
@@ -1 +1 @@
2022-10-23 bd769d002ba9a6f1a1e184ccd65ad3accd7ebeaa
2023-06-09 d932cc5ff1db6bc6ac7be583a1460f7d9557454f
2 changes: 1 addition & 1 deletion platform/genode/recipes/pkg/os2/hash
@@ -1 +1 @@
2022-10-23-c 3fe1301197f2156e79d42e7610c37bcfa6d94bb0
2023-06-09-a a60ecddc01583ad8a6f8690d9b6d344ac1b779ea
2 changes: 1 addition & 1 deletion platform/genode/recipes/raw/os2_fs/hash
@@ -1 +1 @@
2022-10-23-c a58d3c8134304a5f72cf8946b1c5fef7fbbc6689
2023-06-09-a 143a0b29fff34e3ad5b24b11deda3b97ea00ef15
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/compat/hash
@@ -1 +1 @@
2022-10-23 7633277f4d241ace2e24f66f8950b59cd24d6b73
2023-06-09 b894cae0467f355373310d1561e05969d26ee64f
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/handle/hash
@@ -1 +1 @@
2022-10-23 e54a9cfbe6d039b848f0d8496a7ef4fd7da9b2f2
2023-06-09 83310f44cac5410d0350b0d3805ba15170c2e49f
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/libos2app/hash
@@ -1 +1 @@
2022-10-23 30042a31458f04777d794b2e24355f1bb8bed147
2023-06-09 a694c9b6bf34d8ab4a6c0afcb020d94f4781769a
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/libos2exec/hash
@@ -1 +1 @@
2022-10-23 764e652ba581103ecbaf67d387aad6644cec6161
2023-06-09 ce14049585b7933d6f5ba2be962f7456999cad52
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/libos2fs/hash
@@ -1 +1 @@
2022-10-23 cdecff74b72e04f6cfbe512edfa4783e183a7409
2023-06-09 82b7fdbb751c8aafc3aba5df2b6a80dfea4ec1f3
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/libos2srv/hash
@@ -1 +1 @@
2022-10-23 69ec428fb666bf6459277848f4e4e8e2333ad22a
2023-06-09 c118f9bf1037bfa5f6aa957d0d46fed73db98c0b
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/lx/hash
@@ -1 +1 @@
2022-10-23 e99aaf45fe4ab30394ff76961eeb7e4089182111
2023-06-09 dd465034bdaa37e8eb127decdf2061b35f97b153
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/memmgr/hash
@@ -1 +1 @@
2022-10-23 1698e0654b097d14b77d5d1727a277658bc9155a
2023-06-09 c8309ad7bc2175b78ef1ef504c17fe25420c44c3
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/ne/hash
@@ -1 +1 @@
2022-10-23 0a2886543e3ab1832169d5fe0d2035cdd750f574
2023-06-09 ac1ebc36775ccefdb476f804525f3f8477779e05
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/os2app/hash
@@ -1 +1 @@
2022-10-23 363888523f87ac3253a0a9d30abd7f8ddd30e8f5
2023-06-09-a 2e2586834075d193dd65eac77fc263554d61c28f
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/os2exec/hash
@@ -1 +1 @@
2022-10-23 967ac0091aaf5fd01f60dcbfb27c6c57f48c94c0
2023-06-09 1600f54ae066b31779b79e5d57e4a959d45ea4b5
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/os2fs/hash
@@ -1 +1 @@
2022-10-23 e607ecaa3abec1f30f12ade11ca19ddce0b64436
2023-06-09 91faa777c294dbcfdde928db37de039907baa4bf
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/os2srv/hash
@@ -1 +1 @@
2022-10-23 bbc7e4c2f3c6fbe905a82ef9a18ec6f943a39aaa
2023-06-09 f8069b745beff2b133f69f0311d6d7aac0ee3e26
2 changes: 1 addition & 1 deletion platform/genode/recipes/src/tar_rom/hash
@@ -1 +1 @@
2022-10-23 c577de60afac9706246252a2984bc7cbbb3d9eef
2023-06-09 2d8064b3a66f1258f05ab2def44a722392a44dea
2 changes: 2 additions & 0 deletions platform/genode/run/os2.run
Expand Up @@ -142,6 +142,8 @@ set boot_modules {
ld.lib.so
libc.lib.so
libm.lib.so
lx.lib.so
ne.lib.so
vfs.lib.so
compat.lib.so
memmgr.lib.so
Expand Down
15 changes: 13 additions & 2 deletions platform/genode/src/app/os2app/main.cc
Expand Up @@ -19,15 +19,20 @@

#include <genode_env.h>

extern "C" {

Genode::Env *env_ptr = NULL;
Genode::Allocator *alloc_ptr = NULL;

extern "C" {

/* OS/2 server id */
l4_os3_thread_t os2srv;
l4_os3_thread_t fs;

void CPClientInitEnv(Genode::Env &env, Genode::Allocator &alloc);
void FSClientInitEnv(Genode::Env &env, Genode::Allocator &alloc);
void ExcClientInitEnv(Genode::Env &env, Genode::Allocator &alloc);
void CompatInitEnv(Genode::Env &env, Genode::Allocator &alloc);

int init(struct options *opts);
void done(void);

Expand Down Expand Up @@ -76,6 +81,12 @@ struct OS2::App::Main

/* init environment and allocator variables */
init_genode_env(env, heap);
CPClientInitEnv(env, heap);
ExcClientInitEnv(env, heap);
FSClientInitEnv(env, heap);
CompatInitEnv(env, heap);

env_ptr = &env; alloc_ptr = &heap;

/* parse options */
parse_options(config.xml(), &opts);
Expand Down
1 change: 1 addition & 0 deletions platform/genode/src/app/os2app/target.mk
Expand Up @@ -6,6 +6,7 @@ SRC_CC = main.cc kal/thread2.cc
SRC_C = initdone.c api/api.c kal/thread.c \
kal/util.c kal/start.c kal/kal.c kal/dl.c
# disable dead code elimination
#CC_OPT += -O0 -fno-dce -fno-dse -fno-tree-dce -fno-tree-dse
LIBS = base libc compat os2srv os2fs os2exec handle

ifeq ($(filter-out $(SPECS),x86_32),)
Expand Down
10 changes: 10 additions & 0 deletions platform/genode/src/lib/compat/dataspace.cc
Expand Up @@ -20,6 +20,16 @@
/* local includes */
#include "genode_env.h"

Genode::Env *env_ptr;
Genode::Allocator *alloc_ptr;

extern "C"
void CompatInitEnv(Genode::Env &env,
Genode::Allocator &alloc)
{
init_genode_env(env, alloc);
}

extern "C"
long DataspaceAlloc(l4_os3_dataspace_t *ds, ULONG flags,
l4_os3_cap_idx_t dm, ULONG size)
Expand Down
6 changes: 4 additions & 2 deletions platform/genode/src/lib/compat/lock.cc
Expand Up @@ -4,6 +4,7 @@

/* osFree internal */
#include <os3/lock.h>
#include <os3/io.h>

/* Genode includes */
#include <base/allocator.h>
Expand All @@ -20,8 +21,9 @@ LockInit(l4_os3_lock_t **lock, ULONG n)
try
{
**lock = new (alloc) Genode::Mutex();
(n) ? ((Genode::Mutex *)(*lock))->acquire() :
((Genode::Mutex *)(*lock))->release();

if (n)
((Genode::Mutex *)(*lock))->acquire();
}
catch (...)
{
Expand Down
8 changes: 2 additions & 6 deletions platform/genode/src/lib/compat/log.cc
Expand Up @@ -4,12 +4,12 @@
#include <os3/io.h>

/* Genode includes */
#include <base/snprintf.h>
#include <base/log.h>
#include <util/string.h>

/* libc includes */
#include <stdarg.h>
#include <stdio.h>

using namespace Genode;

Expand All @@ -21,12 +21,8 @@ void io_log(const char *chrFormat, ...)
char *s = (char *)buf;
int len;

String_console sc(buf, sizeof(buf));

va_start(arg_ptr, chrFormat);

sc.vprintf(chrFormat, arg_ptr);

vsprintf(buf, chrFormat, arg_ptr);
len = strlen((const char *)s);

// strip a line feed at the end
Expand Down
2 changes: 0 additions & 2 deletions platform/genode/src/lib/compat/thread.h
Expand Up @@ -31,8 +31,6 @@ struct OS2::Thread : Genode::Thread
_flags = flags;
_data = data;

start();

if (_flags & THREAD_SYNC)
{
_term_wait.up();
Expand Down
13 changes: 13 additions & 0 deletions platform/genode/src/lib/os2app/app.cc
@@ -1,6 +1,19 @@
/* osFree internal */
#include <os3/thread.h>

/* local includes */
#include <genode_env.h>

Genode::Env *env_ptr;
Genode::Allocator *alloc_ptr;

extern "C"
void AppClientInitEnv(Genode::Env &env,
Genode::Allocator &alloc)
{
init_genode_env(env, alloc);
}

extern "C"
void AppClientNotify(l4_os3_thread_t client_id)
{
Expand Down
10 changes: 10 additions & 0 deletions platform/genode/src/lib/os2exec/exec.cc
Expand Up @@ -20,6 +20,9 @@
/* local includes */
#include <genode_env.h>

Genode::Env *env_ptr;
Genode::Allocator *alloc_ptr;

using namespace OS2::Cpi;

static Connection *exec;
Expand Down Expand Up @@ -68,6 +71,13 @@ APIRET ExcClientInit(l4_os3_thread_t *thread)
return NO_ERROR;
}

extern "C"
void ExcClientInitEnv(Genode::Env &env,
Genode::Allocator &alloc)
{
init_genode_env(env, alloc);
}

extern "C"
APIRET ExcClientDone(void)
{
Expand Down
10 changes: 10 additions & 0 deletions platform/genode/src/lib/os2fs/fs.cc
Expand Up @@ -19,6 +19,9 @@
/* local includes */
#include "genode_env.h"

Genode::Env *env_ptr;
Genode::Allocator *alloc_ptr;

using namespace OS2::Cpi;

static Connection *fs;
Expand Down Expand Up @@ -67,6 +70,13 @@ APIRET FSClientInit(l4_os3_thread_t *thread)
return NO_ERROR;
}

extern "C"
void FSClientInitEnv(Genode::Env &env,
Genode::Allocator &alloc)
{
init_genode_env(env, alloc);
}

extern "C"
APIRET FSClientDone(void)
{
Expand Down
10 changes: 10 additions & 0 deletions platform/genode/src/lib/os2srv/cpi.cc
Expand Up @@ -21,6 +21,9 @@
/* local includes */
#include "genode_env.h"

Genode::Env *env_ptr;
Genode::Allocator *alloc_ptr;

using namespace OS2::Cpi;

static Connection *cpi;
Expand Down Expand Up @@ -69,6 +72,13 @@ APIRET CPClientInit(l4_os3_thread_t *thread)
return NO_ERROR;
}

extern "C"
void CPClientInitEnv(Genode::Env &env,
Genode::Allocator &alloc)
{
init_genode_env(env, alloc);
}

extern "C"
APIRET CPClientDone(void)
{
Expand Down
17 changes: 13 additions & 4 deletions platform/genode/src/server/os2exec/main.cc
Expand Up @@ -35,11 +35,11 @@

#define OPENFLAG_EXEC 1

extern "C" {

Genode::Env *env_ptr = NULL;
Genode::Allocator *alloc_ptr = NULL;

extern "C" {

struct options
{
char use_events;
Expand All @@ -58,11 +58,15 @@ extern void *shared_memory_base;
extern unsigned long shared_memory_size;
extern unsigned long long shared_memory_area;

void CPClientInitEnv(Genode::Env &env, Genode::Allocator &alloc);
void FSClientInitEnv(Genode::Env &env, Genode::Allocator &alloc);
void CompatInitEnv(Genode::Env &env, Genode::Allocator &alloc);

int init(struct options *opts);
void done(void);

/* Root mem area for memmgr */
struct t_mem_area root_area;
extern struct t_mem_area root_area;

void reserve_regions(void)
{
Expand Down Expand Up @@ -325,7 +329,12 @@ class OS2::Cpi::Root : public Genode::Root_component<Session_component>
Genode::Allocator &alloc)
:
Genode::Root_component<Session_component>(env.ep(), alloc),
_env(env) { init_genode_env(env, alloc); }
_env(env) {
init_genode_env(env, alloc);
CPClientInitEnv(env, alloc);
FSClientInitEnv(env, alloc);
CompatInitEnv(env, alloc);
}
};

struct OS2::Cpi::Main
Expand Down

0 comments on commit f8c09ba

Please sign in to comment.