mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 17:17:38 +00:00
base-foc: coding style
- Cosmetic adjustments according to https://genode.org/documentation/developer-resources/coding_style - Replace manual inclusion of kernel headers by one new compound header foc/syscall.h - Rename namespace Fiasco to Foc
This commit is contained in:
@ -25,17 +25,17 @@ namespace Genode { namespace Capability_space {
|
||||
* Allocate kernel capability selector without associating it with a
|
||||
* Genode capability
|
||||
*/
|
||||
Fiasco::l4_cap_idx_t alloc_kcap();
|
||||
Foc::l4_cap_idx_t alloc_kcap();
|
||||
|
||||
/**
|
||||
* Release kernel capability selector
|
||||
*/
|
||||
void free_kcap(Fiasco::l4_cap_idx_t);
|
||||
void free_kcap(Foc::l4_cap_idx_t);
|
||||
|
||||
/**
|
||||
* Request kernel capability selector associated with Genode capability
|
||||
*/
|
||||
Fiasco::l4_cap_idx_t kcap(Native_capability);
|
||||
Foc::l4_cap_idx_t kcap(Native_capability);
|
||||
|
||||
} }
|
||||
|
||||
|
@ -14,18 +14,16 @@
|
||||
#ifndef _INCLUDE__FOC__NATIVE_CAPABILITY_H_
|
||||
#define _INCLUDE__FOC__NATIVE_CAPABILITY_H_
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/consts.h>
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/task.h>
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Foc {
|
||||
|
||||
/*********************************************
|
||||
** Capability selectors controlled by core **
|
||||
*********************************************/
|
||||
|
||||
/* use the same task cap selector like L4Re for compatibility in L4Linux */
|
||||
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
|
||||
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
|
||||
|
||||
static constexpr l4_cap_idx_t DEBUG_CAP = L4_BASE_DEBUGGER_CAP;
|
||||
|
||||
|
@ -21,23 +21,20 @@
|
||||
/* Genode includes */
|
||||
#include <base/stdint.h>
|
||||
#include <foc/receive_window.h>
|
||||
|
||||
/* Fiasco.OC includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode { struct Native_thread; }
|
||||
|
||||
|
||||
struct Genode::Native_thread
|
||||
{
|
||||
Fiasco::l4_cap_idx_t kcap = 0;
|
||||
Foc::l4_cap_idx_t kcap = 0;
|
||||
|
||||
/* receive window for capability selectors received at the server side */
|
||||
Receive_window rcv_window { };
|
||||
|
||||
Native_thread() { }
|
||||
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }
|
||||
explicit Native_thread(Foc::l4_cap_idx_t kcap) : kcap(kcap) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FOC__NATIVE_THREAD_H_ */
|
||||
|
36
repos/base-foc/include/foc/syscall.h
Normal file
36
repos/base-foc/include/foc/syscall.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* \brief Collection of Fiasco.OC kernel bindings
|
||||
* \author Norman Feske
|
||||
* \date 2020-11-27
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__FOC__SYSCALL_H_
|
||||
#define _INCLUDE__FOC__SYSCALL_H_
|
||||
|
||||
namespace Foc {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/kip>
|
||||
#include <l4/sys/kdebug.h>
|
||||
#include <l4/sys/cache.h>
|
||||
#include <l4/sys/consts.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/task.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/thread.h>
|
||||
#include <l4/sys/factory.h>
|
||||
#include <l4/sys/irq.h>
|
||||
#include <l4/sys/debugger.h>
|
||||
#include <l4/sys/icu.h>
|
||||
#include <l4/sys/ktrace.h>
|
||||
#include <l4/sys/scheduler.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__FOC__SYSCALL_H_ */
|
@ -18,25 +18,21 @@
|
||||
|
||||
#include <base/capability.h>
|
||||
#include <base/thread_state.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode { struct Foc_thread_state; }
|
||||
|
||||
|
||||
struct Genode::Foc_thread_state : Thread_state
|
||||
{
|
||||
Fiasco::l4_cap_idx_t kcap; /* thread's gate cap in its pd */
|
||||
int id; /* id of gate capability */
|
||||
addr_t utcb; /* thread's utcb in its pd */
|
||||
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
|
||||
int id; /* ID of gate capability */
|
||||
addr_t utcb; /* thread's UTCB in its PD */
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Foc_thread_state() : kcap(Fiasco::L4_INVALID_CAP), id(0), utcb(0) { }
|
||||
Foc_thread_state() : kcap(Foc::L4_INVALID_CAP), id(0), utcb(0) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FOC__THREAD_STATE_H_ */
|
||||
|
Reference in New Issue
Block a user