[kernel] Move bind_irq syscall to new system object
In order to implement capabilities on system resources like IRQs so that they may be restricted to drivers only, add a new 'system' kobject type, and move the bind_irq functionality from endpoint to system. Also fix some stack bugs passing the initial handles to a program.
This commit is contained in:
@@ -17,6 +17,7 @@ public:
|
||||
enum class type : uint16_t
|
||||
{
|
||||
none,
|
||||
system,
|
||||
|
||||
event,
|
||||
channel,
|
||||
@@ -24,9 +25,10 @@ public:
|
||||
|
||||
vma,
|
||||
|
||||
job,
|
||||
process,
|
||||
thread,
|
||||
|
||||
max
|
||||
};
|
||||
|
||||
kobject(type t, j6_signal_t signals = 0ull);
|
||||
|
||||
3
src/kernel/objects/system.cpp
Normal file
3
src/kernel/objects/system.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "objects/system.h"
|
||||
|
||||
system system::s_instance;
|
||||
18
src/kernel/objects/system.h
Normal file
18
src/kernel/objects/system.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
/// \file system.h
|
||||
/// Definition of kobject type representing the system
|
||||
|
||||
#include "objects/kobject.h"
|
||||
|
||||
class system :
|
||||
public kobject
|
||||
{
|
||||
public:
|
||||
static constexpr kobject::type type = kobject::type::event;
|
||||
|
||||
inline static system * get() { return &s_instance; }
|
||||
|
||||
private:
|
||||
static system s_instance;
|
||||
system() : kobject(type::system) {}
|
||||
};
|
||||
Reference in New Issue
Block a user