vancouver: Avoid busy startup synchronizations
This commit is contained in:
parent
78204b8f49
commit
c48a7aa27f
|
@ -34,7 +34,6 @@ extern char _binary_mono_tff_start;
|
||||||
Font default_font(&_binary_mono_tff_start);
|
Font default_font(&_binary_mono_tff_start);
|
||||||
|
|
||||||
extern Genode::Lock global_lock;
|
extern Genode::Lock global_lock;
|
||||||
extern bool console_init;
|
|
||||||
|
|
||||||
using Genode::env;
|
using Genode::env;
|
||||||
using Genode::Dataspace_client;
|
using Genode::Dataspace_client;
|
||||||
|
@ -195,7 +194,8 @@ void Vancouver_console::entry()
|
||||||
unsigned unchanged = 0;
|
unsigned unchanged = 0;
|
||||||
bool cmp_even = 1;
|
bool cmp_even = 1;
|
||||||
|
|
||||||
console_init = true;
|
_startup_lock.unlock();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
while (!input.is_pending()) {
|
while (!input.is_pending()) {
|
||||||
|
|
||||||
|
@ -304,8 +304,12 @@ void Vancouver_console::entry()
|
||||||
Vancouver_console::Vancouver_console(Motherboard &mb, Genode::size_t vm_fb_size,
|
Vancouver_console::Vancouver_console(Motherboard &mb, Genode::size_t vm_fb_size,
|
||||||
Genode::Dataspace_capability fb_ds)
|
Genode::Dataspace_capability fb_ds)
|
||||||
:
|
:
|
||||||
|
_startup_lock(Genode::Lock::LOCKED),
|
||||||
_vm_fb_size(vm_fb_size), _mb(mb), _fb_size(0), _pixels(0), _guest_fb(0),
|
_vm_fb_size(vm_fb_size), _mb(mb), _fb_size(0), _pixels(0), _guest_fb(0),
|
||||||
_regs(0), _fb_ds(fb_ds)
|
_regs(0), _fb_ds(fb_ds)
|
||||||
{
|
{
|
||||||
start();
|
start();
|
||||||
|
|
||||||
|
/* shake hands with console thread */
|
||||||
|
_startup_lock.lock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Vancouver_console : public Thread<8192>, public StaticReceiver<Vancouver_c
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Genode::Lock _startup_lock;
|
||||||
Motherboard &_mb;
|
Motherboard &_mb;
|
||||||
short *_pixels;
|
short *_pixels;
|
||||||
char *_guest_fb;
|
char *_guest_fb;
|
||||||
|
|
|
@ -32,13 +32,13 @@
|
||||||
static Genode::Native_utcb utcb_backup;
|
static Genode::Native_utcb utcb_backup;
|
||||||
|
|
||||||
extern Genode::Lock timeouts_lock;
|
extern Genode::Lock timeouts_lock;
|
||||||
extern bool disk_init;
|
|
||||||
|
|
||||||
|
|
||||||
Vancouver_disk::Vancouver_disk(Motherboard &mb,
|
Vancouver_disk::Vancouver_disk(Motherboard &mb,
|
||||||
char * backing_store_base,
|
char * backing_store_base,
|
||||||
char * backing_store_fb_base)
|
char * backing_store_fb_base)
|
||||||
:
|
:
|
||||||
|
_startup_lock(Genode::Lock::LOCKED),
|
||||||
_mb(mb), _backing_store_base(backing_store_base),
|
_mb(mb), _backing_store_base(backing_store_base),
|
||||||
_backing_store_fb_base(backing_store_fb_base)
|
_backing_store_fb_base(backing_store_fb_base)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,9 @@ Vancouver_disk::Vancouver_disk(Motherboard &mb,
|
||||||
_diskcon[i].blk_size = 0;
|
_diskcon[i].blk_size = 0;
|
||||||
}
|
}
|
||||||
start();
|
start();
|
||||||
|
|
||||||
|
/* shake hands with disk thread */
|
||||||
|
_startup_lock.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +60,7 @@ void Vancouver_disk::entry()
|
||||||
/* attach to disk bus */
|
/* attach to disk bus */
|
||||||
_mb.bus_disk.add(this, receive_static<MessageDisk>);
|
_mb.bus_disk.add(this, receive_static<MessageDisk>);
|
||||||
|
|
||||||
disk_init = true;
|
_startup_lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ class Vancouver_disk : public Genode::Thread<8192>, public StaticReceiver<Vancou
|
||||||
Genode::size_t blk_cnt;
|
Genode::size_t blk_cnt;
|
||||||
} _diskcon[MAX_DISKS];
|
} _diskcon[MAX_DISKS];
|
||||||
|
|
||||||
|
Genode::Lock _startup_lock;
|
||||||
Motherboard &_mb;
|
Motherboard &_mb;
|
||||||
char *_backing_store_base;
|
char *_backing_store_base;
|
||||||
char *_backing_store_fb_base;
|
char *_backing_store_fb_base;
|
||||||
|
|
|
@ -92,9 +92,6 @@ Genode::Lock *utcb_lock()
|
||||||
Genode::Lock global_lock(Genode::Lock::LOCKED);
|
Genode::Lock global_lock(Genode::Lock::LOCKED);
|
||||||
Genode::Lock timeouts_lock(Genode::Lock::UNLOCKED);
|
Genode::Lock timeouts_lock(Genode::Lock::UNLOCKED);
|
||||||
|
|
||||||
volatile bool console_init = false;
|
|
||||||
volatile bool disk_init = false;
|
|
||||||
|
|
||||||
|
|
||||||
/* timer service */
|
/* timer service */
|
||||||
using Genode::Thread;
|
using Genode::Thread;
|
||||||
|
@ -1622,9 +1619,6 @@ int main(int argc, char **argv)
|
||||||
guest_memory.backing_store_local_base(),
|
guest_memory.backing_store_local_base(),
|
||||||
guest_memory.backing_store_fb_local_base());
|
guest_memory.backing_store_fb_local_base());
|
||||||
|
|
||||||
/* wait for services */
|
|
||||||
while (!console_init || !disk_init);
|
|
||||||
|
|
||||||
machine.setup_devices(Genode::config()->xml_node().sub_node("machine"));
|
machine.setup_devices(Genode::config()->xml_node().sub_node("machine"));
|
||||||
|
|
||||||
Genode::printf("\n--- Booting VM ---\n");
|
Genode::printf("\n--- Booting VM ---\n");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user