Skip to content

Basic Linux framebuffer ioctl functions #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/abi/unknown-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ namespace riscv {
abi_fcntl_F_DUPFD_CLOEXEC = 1030,

abi_ioctl_TIOCGWINSZ = 0x5413,
abi_ioctl_FBIOGET_VSCREENINFO = 0x4600,
abi_ioctl_FBIOGET_FSCREENINFO = 0x4602,

abi_mmap_PROT_READ = 1,
abi_mmap_PROT_WRITE = 2,
Expand Down Expand Up @@ -493,6 +495,30 @@ namespace riscv {
proc.ireg[rv_ireg_a0] = cvt_error(ret);
break;
}
case abi_ioctl_FBIOGET_VSCREENINFO: {
int ret = ioctl(
(long)proc.ireg[rv_ireg_a0],
FBIOGET_VSCREENINFO,
(void*)proc.ireg[rv_ireg_a2].r.xu.val);
if (proc.log & proc_log_syscall) {
printf("ioctl(%ld,FBIOGET_VSCREENINFO,%ld) = %d\n",
(long)proc.ireg[rv_ireg_a0], (long)proc.ireg[rv_ireg_a2], cvt_error(ret));
}
proc.ireg[rv_ireg_a0] = cvt_error(ret);
break;
}
case abi_ioctl_FBIOGET_FSCREENINFO: {
int ret = ioctl(
(long)proc.ireg[rv_ireg_a0],
FBIOGET_FSCREENINFO,
(void*)proc.ireg[rv_ireg_a2].r.xu.val);
if (proc.log & proc_log_syscall) {
printf("ioctl(%ld,FBIOGET_FSCREENINFO,%ld) = %d\n",
(long)proc.ireg[rv_ireg_a0], (long)proc.ireg[rv_ireg_a2], cvt_error(ret));
}
proc.ireg[rv_ireg_a0] = cvt_error(ret);
break;
}
default:
if (proc.log & proc_log_syscall) {
printf("ioctl(%ld,%ld) = %d\n",
Expand Down
1 change: 1 addition & 0 deletions src/app/rv-jit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <sys/resource.h>
#include <linux/fb.h>

#include "host-endian.h"
#include "types.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/rv-sim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <sys/resource.h>
#include <linux/fb.h>

#include "host-endian.h"
#include "types.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/test-jit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <sys/resource.h>
#include <linux/fb.h>

#include "host-endian.h"
#include "types.h"
Expand Down