gpgpu namespace

This commit is contained in:
Marcel Lütke Dreimann
2022-08-24 11:37:33 +02:00
parent ae14435d41
commit 8759c0d52e
8 changed files with 26 additions and 6 deletions

View File

@@ -3,6 +3,9 @@
#define GENODE // use genodes stdint header
#include "../uos-intel-gpgpu/driver/gpgpu_driver.h"
namespace gpgpu
{
void gpgpu_genode::handleInterrupt()
{
// handle the gpu interrupt
@@ -190,3 +193,5 @@ void gpgpu_genode::freeRamCap(Genode::Ram_dataspace_capability& ram_cap)
{
pci.free_dma_buffer(ram_cap);
}
}

View File

@@ -19,6 +19,9 @@ using namespace Genode;
// interrupts
#include <irq_session/connection.h>
namespace gpgpu
{
class gpgpu_genode
{
private:
@@ -149,4 +152,6 @@ public:
void freeRamCap(Genode::Ram_dataspace_capability& ram_cap);
};
}
#endif // GPGPU_GENODE_H

View File

@@ -14,7 +14,7 @@
#include "test.h"
#endif // TEST
gpgpu_genode* _global_gpgpu_genode;
gpgpu::gpgpu_genode* _global_gpgpu_genode;
gpgpu_virt::Scheduler* _global_sched;
void Component::construct(Genode::Env& e)
@@ -23,7 +23,7 @@ void Component::construct(Genode::Env& e)
Genode::log("Build: ", __TIMESTAMP__);
// init globals
static gpgpu_genode gg(e);
static gpgpu::gpgpu_genode gg(e);
_global_gpgpu_genode = &gg;
static gpgpu_virt::Scheduler sched;
_global_sched = &sched;
@@ -90,7 +90,7 @@ void Component::construct(Genode::Env& e)
// run the test and hope the best
Genode::log("Run self test...");
run_gpgpu_test();
gpgpu::run_gpgpu_test();
#endif // TEST
Genode::log("Register RPCs...");

View File

@@ -9,7 +9,7 @@ using namespace Genode;
// genode instance
#include "gpgpu_genode.h"
extern gpgpu_genode* _global_gpgpu_genode;
extern gpgpu::gpgpu_genode* _global_gpgpu_genode;
// printing (optional)
extern "C" int printk(const char* str, ...)

View File

@@ -4,6 +4,9 @@
#define ELEMENTS 4096
namespace gpgpu
{
uint32_t* in;
uint32_t* out;
@@ -207,3 +210,5 @@ void run_gpgpu_test()
// wait for its end
while(!kconf.finished);
}
}

View File

@@ -1,10 +1,15 @@
#ifndef TEST_H
#define TEST_H
namespace gpgpu
{
/**
* @brief run a test kernel
*
*/
void run_gpgpu_test();
}
#endif // TEST_H

View File

@@ -9,7 +9,7 @@
// genode instance
#include "../gpgpu/gpgpu_genode.h"
extern gpgpu_genode* _global_gpgpu_genode;
extern gpgpu::gpgpu_genode* _global_gpgpu_genode;
extern gpgpu_virt::Scheduler* _global_sched;
// driver

View File

@@ -3,7 +3,7 @@
// genode instance
#include "../gpgpu/gpgpu_genode.h"
extern gpgpu_genode* _global_gpgpu_genode;
extern gpgpu::gpgpu_genode* _global_gpgpu_genode;
// driver
#define GENODE