mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 15:43:56 +00:00
committed by
Christian Helmuth
parent
7bed3967ae
commit
e370e08e01
@ -83,6 +83,7 @@ drm_display_mode *
|
||||
Framebuffer::Driver::_preferred_mode(drm_connector *connector)
|
||||
{
|
||||
using namespace Genode;
|
||||
using Genode::size_t;
|
||||
|
||||
/* try to read configuration for connector */
|
||||
try {
|
||||
|
@ -189,7 +189,7 @@ class Lx::Pci_dev : public pci_dev, public Lx_kit::List<Pci_dev>::Element
|
||||
[&] () { _client.config_write(devfn, val, _access_size(val)); },
|
||||
[&] () {
|
||||
char quota[32];
|
||||
Genode::snprintf(quota, sizeof(quota), "ram_quota=%zd",
|
||||
Genode::snprintf(quota, sizeof(quota), "ram_quota=%ld",
|
||||
donate);
|
||||
Genode::env()->parent()->upgrade(pci()->cap(), quota);
|
||||
donate *= 2;
|
||||
|
@ -28,6 +28,10 @@ namespace Lx { class Slab_alloc; }
|
||||
|
||||
class Lx::Slab_alloc : public Genode::Slab
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Genode::size_t size_t;
|
||||
|
||||
private:
|
||||
|
||||
size_t const _object_size;
|
||||
|
@ -39,7 +39,7 @@ class Lx::Slab_backend_alloc : public Genode::Allocator
|
||||
/**
|
||||
* Allocate
|
||||
*/
|
||||
virtual bool alloc(size_t size, void **out_addr) = 0;
|
||||
virtual bool alloc(Genode::size_t size, void **out_addr) = 0;
|
||||
virtual void free(void *addr) = 0;
|
||||
|
||||
/**
|
||||
|
@ -32,6 +32,8 @@ class Lx::Malloc : public Genode::Allocator
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Genode::size_t size_t;
|
||||
|
||||
enum { MAX_SIZE_LOG2 = 16 /* 64 KiB */ };
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ namespace Lx {
|
||||
|
||||
void *ioremap(addr_t, unsigned long, Cache_attribute);
|
||||
void iounmap(volatile void*);
|
||||
Dataspace_capability ioremap_lookup(addr_t, size_t);
|
||||
Dataspace_capability ioremap_lookup(addr_t, Genode::size_t);
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
namespace Usb_nic {
|
||||
using namespace Genode;
|
||||
using Genode::size_t;
|
||||
class Session_component;
|
||||
struct Device;
|
||||
};
|
||||
@ -231,6 +232,7 @@ class Root : public Root_component
|
||||
Usb_nic::Session_component *_create_session(const char *args)
|
||||
{
|
||||
using namespace Genode;
|
||||
using Genode::size_t;
|
||||
|
||||
size_t ram_quota = Arg_string::find_arg(args, "ram_quota" ).ulong_value(0);
|
||||
size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0);
|
||||
@ -247,7 +249,7 @@ class Root : public Root_component
|
||||
*/
|
||||
if (tx_buf_size + rx_buf_size < tx_buf_size ||
|
||||
tx_buf_size + rx_buf_size > ram_quota - session_size) {
|
||||
Genode::error("insufficient 'ram_quota', got ", ram_quota, " need %zd",
|
||||
Genode::error("insufficient 'ram_quota', got ", ram_quota, " need %ld",
|
||||
tx_buf_size + rx_buf_size + session_size);
|
||||
throw Genode::Root::Quota_exceeded();
|
||||
}
|
||||
|
@ -793,6 +793,7 @@ class Usb::Root : public Genode::Root_component<Session_component>
|
||||
Session_component *_create_session(const char *args)
|
||||
{
|
||||
using namespace Genode;
|
||||
using Genode::size_t;
|
||||
|
||||
Session_label const label = label_from_args(args);
|
||||
try {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <lx_kit/scheduler.h>
|
||||
|
||||
|
||||
typedef Genode::size_t size_t;
|
||||
typedef ::size_t size_t;
|
||||
typedef Genode::addr_t addr_t;
|
||||
|
||||
|
||||
|
@ -173,6 +173,7 @@ class Root : public Genode::Root_component<Wifi_session_component,
|
||||
Wifi_session_component *_create_session(const char *args)
|
||||
{
|
||||
using namespace Genode;
|
||||
using Genode::size_t;
|
||||
|
||||
size_t ram_quota = Arg_string::find_arg(args, "ram_quota" ).ulong_value(0);
|
||||
size_t tx_buf_size = Arg_string::find_arg(args, "tx_buf_size").ulong_value(0);
|
||||
|
@ -85,12 +85,12 @@ Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached)
|
||||
cap = env()->ram_session()->alloc(size);
|
||||
o = new (env()->heap()) Ram_object(cap);
|
||||
} else {
|
||||
size_t donate = size;
|
||||
Genode::size_t donate = size;
|
||||
cap = retry<Platform::Session::Out_of_metadata>(
|
||||
[&] () { return Lx::pci()->alloc_dma_buffer(size); },
|
||||
[&] () {
|
||||
char quota[32];
|
||||
Genode::snprintf(quota, sizeof(quota), "ram_quota=%zd",
|
||||
Genode::snprintf(quota, sizeof(quota), "ram_quota=%ld",
|
||||
donate);
|
||||
Genode::env()->parent()->upgrade(Lx::pci()->cap(), quota);
|
||||
donate = donate * 2 > size ? 4096 : donate * 2;
|
||||
|
Reference in New Issue
Block a user