Skip to content

Commit

Permalink
Backport virtualbox guest driver fix from nih
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jun 13, 2018
1 parent 418f5a7 commit 953f522
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/vboxguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,21 @@ static struct vbox_mouse * vbox_m;
static uint32_t vbox_phys_mouse;
static struct vbox_mouse * vbox_mg;
static uint32_t vbox_phys_mouse_get;
static uint32_t * vbox_vmmdev = 0;
static volatile uint32_t * vbox_vmmdev = 0;

static fs_node_t * mouse_pipe;

#define PACKETS_IN_PIPE 1024
#define DISCARD_POINT 32

static int vbox_irq_handler(struct regs *r) {
outportl(vbox_port, vbox_phys_disp);
outportl(vbox_port, vbox_phys_mouse_get);
if (!vbox_vmmdev[2]) return 0;

vbox_irq_ack->events = vbox_vmmdev[2];
outportl(vbox_port, vbox_phys_ack);
irq_ack(vbox_irq);

outportl(vbox_port, vbox_phys_mouse_get);
if (lfb_vid_memory && lfb_resolution_x && lfb_resolution_y && vbox_mg->x && vbox_mg->y) {
unsigned int x = ((unsigned int)vbox_mg->x * lfb_resolution_x) / 0xFFFF;
unsigned int y = ((unsigned int)vbox_mg->y * lfb_resolution_y) / 0xFFFF;
Expand All @@ -121,7 +123,7 @@ static int vbox_irq_handler(struct regs *r) {
write_fs(mouse_pipe, 0, sizeof(packet), (uint8_t *)&packet);
}


outportl(vbox_port, vbox_phys_disp);
if (lfb_resolution_x && vbox_disp->xres && (vbox_disp->xres != lfb_resolution_x || vbox_disp->yres != lfb_resolution_y)) {

lfb_set_resolution(vbox_disp->xres, vbox_disp->yres);
Expand Down

0 comments on commit 953f522

Please sign in to comment.