mirror of
https://github.com/reactos/syzkaller.git
synced 2024-12-01 07:10:37 +00:00
sys: describe more dri syscalls
This commit is contained in:
parent
b1f7eb0c30
commit
9c277c7974
@ -364,6 +364,12 @@ thread_t* schedule_call(int n, int call_index, int call_num, uint64_t num_args,
|
||||
case __NR_syz_fuse_mount:
|
||||
case __NR_syz_fuseblk_mount:
|
||||
root = true;
|
||||
default:
|
||||
// Lots of dri ioctls require root.
|
||||
// There are some generic permission checks that hopefully don't contain bugs,
|
||||
// so let's just execute all them under root.
|
||||
if (strncmp(syscalls[call_num].name, "ioctl$DRM", sizeof("ioctl$DRM")) == 0)
|
||||
root = true;
|
||||
}
|
||||
|
||||
// Find a spare thread to execute the call.
|
||||
|
@ -640,6 +640,8 @@ call_t syscalls[] = {
|
||||
{"write$fuse_notify_store", 1},
|
||||
{"write$fuse_notify_retrieve", 1},
|
||||
{"syz_open_dev$dri", 1000001},
|
||||
{"syz_open_dev$dricontrol", 1000001},
|
||||
{"syz_open_dev$drirender", 1000001},
|
||||
{"ioctl$DRM_IOCTL_VERSION", 16},
|
||||
{"ioctl$DRM_IOCTL_GET_UNIQUE", 16},
|
||||
{"ioctl$DRM_IOCTL_GET_MAGIC", 16},
|
||||
@ -650,6 +652,50 @@ call_t syscalls[] = {
|
||||
{"ioctl$DRM_IOCTL_GET_CAP", 16},
|
||||
{"ioctl$DRM_IOCTL_SET_CLIENT_CAP", 16},
|
||||
{"ioctl$DRM_IOCTL_SET_VERSION", 16},
|
||||
{"ioctl$DRM_IOCTL_SET_UNIQUE", 16},
|
||||
{"ioctl$DRM_IOCTL_AUTH_MAGIC", 16},
|
||||
{"ioctl$DRM_IOCTL_ADD_MAP", 16},
|
||||
{"ioctl$DRM_IOCTL_RM_MAP", 16},
|
||||
{"ioctl$DRM_IOCTL_SET_SAREA_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_GET_SAREA_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_SET_MASTER", 16},
|
||||
{"ioctl$DRM_IOCTL_DROP_MASTER", 16},
|
||||
{"ioctl$DRM_IOCTL_ADD_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_RM_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_GET_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_SWITCH_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_NEW_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_RES_CTX", 16},
|
||||
{"ioctl$DRM_IOCTL_LOCK", 16},
|
||||
{"ioctl$DRM_IOCTL_UNLOCK", 16},
|
||||
{"ioctl$DRM_IOCTL_ADD_BUFS", 16},
|
||||
{"ioctl$DRM_IOCTL_MARK_BUFS", 16},
|
||||
{"ioctl$DRM_IOCTL_INFO_BUFS", 16},
|
||||
{"ioctl$DRM_IOCTL_MAP_BUFS", 16},
|
||||
{"ioctl$DRM_IOCTL_FREE_BUFS", 16},
|
||||
{"ioctl$DRM_IOCTL_DMA", 16},
|
||||
{"ioctl$DRM_IOCTL_CONTROL", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_ACQUIRE", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_RELEASE", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_ENABLE", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_INFO", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_ALLOC", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_FREE", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_BIND", 16},
|
||||
{"ioctl$DRM_IOCTL_AGP_UNBIND", 16},
|
||||
{"ioctl$DRM_IOCTL_SG_ALLOC", 16},
|
||||
{"ioctl$DRM_IOCTL_SG_FREE", 16},
|
||||
{"ioctl$DRM_IOCTL_WAIT_VBLANK", 16},
|
||||
{"ioctl$DRM_IOCTL_MODESET_CTL", 16},
|
||||
{"ioctl$DRM_IOCTL_GEM_CLOSE", 16},
|
||||
{"ioctl$DRM_IOCTL_GEM_FLINK", 16},
|
||||
{"ioctl$DRM_IOCTL_GEM_OPEN", 16},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETRESOURCES", 16},
|
||||
{"ioctl$DRM_IOCTL_PRIME_HANDLE_TO_FD", 16},
|
||||
{"ioctl$DRM_IOCTL_PRIME_FD_TO_HANDLE", 16},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETPLANERESOURCES", 16},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETCRTC", 16},
|
||||
{"ioctl$DRM_IOCTL_MODE_SETCRTC", 16},
|
||||
{"open$kdbus", 2},
|
||||
{"ioctl$kdbus_bus_make", 16},
|
||||
{"ioctl$kdbus_ep_make", 16},
|
||||
@ -1544,6 +1590,8 @@ call_t syscalls[] = {
|
||||
{"write$fuse_notify_store", 64},
|
||||
{"write$fuse_notify_retrieve", 64},
|
||||
{"syz_open_dev$dri", 1000001},
|
||||
{"syz_open_dev$dricontrol", 1000001},
|
||||
{"syz_open_dev$drirender", 1000001},
|
||||
{"ioctl$DRM_IOCTL_VERSION", 29},
|
||||
{"ioctl$DRM_IOCTL_GET_UNIQUE", 29},
|
||||
{"ioctl$DRM_IOCTL_GET_MAGIC", 29},
|
||||
@ -1554,6 +1602,50 @@ call_t syscalls[] = {
|
||||
{"ioctl$DRM_IOCTL_GET_CAP", 29},
|
||||
{"ioctl$DRM_IOCTL_SET_CLIENT_CAP", 29},
|
||||
{"ioctl$DRM_IOCTL_SET_VERSION", 29},
|
||||
{"ioctl$DRM_IOCTL_SET_UNIQUE", 29},
|
||||
{"ioctl$DRM_IOCTL_AUTH_MAGIC", 29},
|
||||
{"ioctl$DRM_IOCTL_ADD_MAP", 29},
|
||||
{"ioctl$DRM_IOCTL_RM_MAP", 29},
|
||||
{"ioctl$DRM_IOCTL_SET_SAREA_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_GET_SAREA_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_SET_MASTER", 29},
|
||||
{"ioctl$DRM_IOCTL_DROP_MASTER", 29},
|
||||
{"ioctl$DRM_IOCTL_ADD_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_RM_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_GET_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_SWITCH_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_NEW_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_RES_CTX", 29},
|
||||
{"ioctl$DRM_IOCTL_LOCK", 29},
|
||||
{"ioctl$DRM_IOCTL_UNLOCK", 29},
|
||||
{"ioctl$DRM_IOCTL_ADD_BUFS", 29},
|
||||
{"ioctl$DRM_IOCTL_MARK_BUFS", 29},
|
||||
{"ioctl$DRM_IOCTL_INFO_BUFS", 29},
|
||||
{"ioctl$DRM_IOCTL_MAP_BUFS", 29},
|
||||
{"ioctl$DRM_IOCTL_FREE_BUFS", 29},
|
||||
{"ioctl$DRM_IOCTL_DMA", 29},
|
||||
{"ioctl$DRM_IOCTL_CONTROL", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_ACQUIRE", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_RELEASE", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_ENABLE", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_INFO", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_ALLOC", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_FREE", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_BIND", 29},
|
||||
{"ioctl$DRM_IOCTL_AGP_UNBIND", 29},
|
||||
{"ioctl$DRM_IOCTL_SG_ALLOC", 29},
|
||||
{"ioctl$DRM_IOCTL_SG_FREE", 29},
|
||||
{"ioctl$DRM_IOCTL_WAIT_VBLANK", 29},
|
||||
{"ioctl$DRM_IOCTL_MODESET_CTL", 29},
|
||||
{"ioctl$DRM_IOCTL_GEM_CLOSE", 29},
|
||||
{"ioctl$DRM_IOCTL_GEM_FLINK", 29},
|
||||
{"ioctl$DRM_IOCTL_GEM_OPEN", 29},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETRESOURCES", 29},
|
||||
{"ioctl$DRM_IOCTL_PRIME_HANDLE_TO_FD", 29},
|
||||
{"ioctl$DRM_IOCTL_PRIME_FD_TO_HANDLE", 29},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETPLANERESOURCES", 29},
|
||||
{"ioctl$DRM_IOCTL_MODE_GETCRTC", 29},
|
||||
{"ioctl$DRM_IOCTL_MODE_SETCRTC", 29},
|
||||
{"open$kdbus", -1},
|
||||
{"ioctl$kdbus_bus_make", 29},
|
||||
{"ioctl$kdbus_ep_make", 29},
|
||||
|
@ -161,7 +161,7 @@ func assignTypeAndDir(c *Call) error {
|
||||
}
|
||||
arg.Call = c
|
||||
if arg.Type != nil && arg.Type.Name() != typ.Name() {
|
||||
panic("different type is already assigned")
|
||||
panic("different type is already assigned: " + arg.Type.Name() + " vs " + typ.Name())
|
||||
}
|
||||
arg.Type = typ
|
||||
switch arg.Kind {
|
||||
|
@ -137,16 +137,68 @@ const (
|
||||
DN_MODIFY = 2
|
||||
DN_MULTISHOT = 2147483648
|
||||
DN_RENAME = 16
|
||||
DRM_ADD_COMMAND = 0
|
||||
DRM_DISPLAY_MODE_LEN = 32
|
||||
DRM_INST_HANDLER = 2
|
||||
DRM_IOCTL_ADD_BUFS = 3223348246
|
||||
DRM_IOCTL_ADD_CTX = 3221775392
|
||||
DRM_IOCTL_ADD_MAP = 3223872533
|
||||
DRM_IOCTL_AGP_ACQUIRE = 25648
|
||||
DRM_IOCTL_AGP_ALLOC = 3223348276
|
||||
DRM_IOCTL_AGP_BIND = 1074816054
|
||||
DRM_IOCTL_AGP_ENABLE = 1074291762
|
||||
DRM_IOCTL_AGP_FREE = 1075864629
|
||||
DRM_IOCTL_AGP_INFO = 2151179315
|
||||
DRM_IOCTL_AGP_RELEASE = 25649
|
||||
DRM_IOCTL_AGP_UNBIND = 1074816055
|
||||
DRM_IOCTL_AUTH_MAGIC = 1074029585
|
||||
DRM_IOCTL_CONTROL = 1074291732
|
||||
DRM_IOCTL_DMA = 3225445417
|
||||
DRM_IOCTL_DROP_MASTER = 25631
|
||||
DRM_IOCTL_FREE_BUFS = 1074816026
|
||||
DRM_IOCTL_GEM_CLOSE = 1074291721
|
||||
DRM_IOCTL_GEM_FLINK = 3221775370
|
||||
DRM_IOCTL_GEM_OPEN = 3222299659
|
||||
DRM_IOCTL_GET_CAP = 3222299660
|
||||
DRM_IOCTL_GET_CLIENT = 3223872517
|
||||
DRM_IOCTL_GET_CTX = 3221775395
|
||||
DRM_IOCTL_GET_MAGIC = 2147771394
|
||||
DRM_IOCTL_GET_MAP = 3223872516
|
||||
DRM_IOCTL_GET_SAREA_CTX = 3222299677
|
||||
DRM_IOCTL_GET_STATS = 2163762182
|
||||
DRM_IOCTL_GET_UNIQUE = 3222299649
|
||||
DRM_IOCTL_INFO_BUFS = 3222299672
|
||||
DRM_IOCTL_IRQ_BUSID = 3222299651
|
||||
DRM_IOCTL_LOCK = 1074291754
|
||||
DRM_IOCTL_MAP_BUFS = 3222823961
|
||||
DRM_IOCTL_MARK_BUFS = 1075864599
|
||||
DRM_IOCTL_MODESET_CTL = 1074291720
|
||||
DRM_IOCTL_MODE_ATOMIC = 3221513404
|
||||
DRM_IOCTL_MODE_CREATEPROPBLOB = 3221513405
|
||||
DRM_IOCTL_MODE_DESTROYPROPBLOB = 3221513406
|
||||
DRM_IOCTL_MODE_GETCRTC = 3228066977
|
||||
DRM_IOCTL_MODE_GETPLANERESOURCES = 3222299829
|
||||
DRM_IOCTL_MODE_GETRESOURCES = 3225445536
|
||||
DRM_IOCTL_MODE_SETCRTC = 3228066978
|
||||
DRM_IOCTL_NEW_CTX = 1074291749
|
||||
DRM_IOCTL_PRIME_FD_TO_HANDLE = 3222037550
|
||||
DRM_IOCTL_PRIME_HANDLE_TO_FD = 3222037549
|
||||
DRM_IOCTL_RES_CTX = 3222299686
|
||||
DRM_IOCTL_RM_CTX = 3221775393
|
||||
DRM_IOCTL_RM_MAP = 1076388891
|
||||
DRM_IOCTL_SET_CLIENT_CAP = 1074816013
|
||||
DRM_IOCTL_SET_MASTER = 25630
|
||||
DRM_IOCTL_SET_SAREA_CTX = 1074816028
|
||||
DRM_IOCTL_SET_UNIQUE = 1074816016
|
||||
DRM_IOCTL_SET_VERSION = 3222299655
|
||||
DRM_IOCTL_SG_ALLOC = 3222299704
|
||||
DRM_IOCTL_SG_FREE = 1074816057
|
||||
DRM_IOCTL_SWITCH_CTX = 1074291748
|
||||
DRM_IOCTL_UNLOCK = 1074291755
|
||||
DRM_IOCTL_VERSION = 3225445376
|
||||
DRM_IOCTL_WAIT_VBLANK = 3222823994
|
||||
DRM_RM_COMMAND = 1
|
||||
DRM_UNINST_HANDLER = 3
|
||||
EFD_CLOEXEC = 524288
|
||||
EFD_NONBLOCK = 2048
|
||||
EFD_SEMAPHORE = 1
|
||||
@ -1543,18 +1595,45 @@ const (
|
||||
XATTR_CREATE = 1
|
||||
XATTR_REPLACE = 2
|
||||
_DRM_AGP = 3
|
||||
_DRM_AGP_BUFFER = 2
|
||||
_DRM_CONSISTENT = 5
|
||||
_DRM_CONTAINS_LOCK = 32
|
||||
_DRM_CONTEXT_2DONLY = 2
|
||||
_DRM_CONTEXT_PRESERVED = 1
|
||||
_DRM_DMA_BLOCK = 1
|
||||
_DRM_DMA_LARGER_OK = 64
|
||||
_DRM_DMA_PRIORITY = 4
|
||||
_DRM_DMA_SMALLER_OK = 32
|
||||
_DRM_DMA_WAIT = 16
|
||||
_DRM_DMA_WHILE_LOCKED = 2
|
||||
_DRM_DRIVER = 128
|
||||
_DRM_FB_BUFFER = 8
|
||||
_DRM_FRAME_BUFFER = 0
|
||||
_DRM_HALT_ALL_QUEUES = 16
|
||||
_DRM_HALT_CUR_QUEUES = 32
|
||||
_DRM_KERNEL = 8
|
||||
_DRM_LOCKED = 4
|
||||
_DRM_LOCK_FLUSH = 4
|
||||
_DRM_LOCK_FLUSH_ALL = 8
|
||||
_DRM_LOCK_QUIESCENT = 2
|
||||
_DRM_LOCK_READY = 1
|
||||
_DRM_PAGE_ALIGN = 1
|
||||
_DRM_PCI_BUFFER_RO = 16
|
||||
_DRM_READ_ONLY = 2
|
||||
_DRM_REGISTERS = 1
|
||||
_DRM_REMOVABLE = 64
|
||||
_DRM_RESTRICTED = 1
|
||||
_DRM_SCATTER_GATHER = 4
|
||||
_DRM_SG_BUFFER = 4
|
||||
_DRM_SHM = 2
|
||||
_DRM_VBLANK_ABSOLUTE = 0
|
||||
_DRM_VBLANK_EVENT = 67108864
|
||||
_DRM_VBLANK_FLIP = 134217728
|
||||
_DRM_VBLANK_HIGH_CRTC_MASK = 62
|
||||
_DRM_VBLANK_NEXTONMISS = 268435456
|
||||
_DRM_VBLANK_RELATIVE = 1
|
||||
_DRM_VBLANK_SECONDARY = 536870912
|
||||
_DRM_VBLANK_SIGNAL = 1073741824
|
||||
_DRM_WRITE_COMBINING = 16
|
||||
__WALL = 1073741824
|
||||
__WCLONE = 2147483648
|
||||
|
@ -63,6 +63,7 @@ const (
|
||||
ResGid
|
||||
ResTimerid
|
||||
ResIocbPtr
|
||||
ResDrmCtx
|
||||
)
|
||||
|
||||
const (
|
||||
@ -138,7 +139,7 @@ func ResourceSubkinds(kind ResourceKind) []ResourceSubkind {
|
||||
FdKvmCpu, FdSndSeq, FdSndTimer, FdSndControl, FdInputEvent}
|
||||
case ResIPC:
|
||||
return []ResourceSubkind{IPCMsq, IPCSem, IPCShm}
|
||||
case ResIOCtx, ResKey, ResInotifyDesc, ResPid, ResUid, ResGid, ResTimerid, ResIocbPtr:
|
||||
case ResIOCtx, ResKey, ResInotifyDesc, ResPid, ResUid, ResGid, ResTimerid, ResIocbPtr, ResDrmCtx:
|
||||
return []ResourceSubkind{ResAny}
|
||||
default:
|
||||
panic("unknown resource kind")
|
||||
@ -181,6 +182,8 @@ func (t ResourceType) Default() uintptr {
|
||||
return 0
|
||||
case ResTimerid:
|
||||
return 0
|
||||
case ResDrmCtx:
|
||||
return 0
|
||||
default:
|
||||
panic("unknown resource type")
|
||||
}
|
||||
@ -208,6 +211,8 @@ func (t ResourceType) SpecialValues() []uintptr {
|
||||
return []uintptr{0, ^uintptr(0)}
|
||||
case ResTimerid:
|
||||
return []uintptr{0}
|
||||
case ResDrmCtx:
|
||||
return []uintptr{0}
|
||||
default:
|
||||
panic("unknown resource kind")
|
||||
}
|
||||
@ -233,6 +238,8 @@ func (t ResourceType) Size() uintptr {
|
||||
return 4
|
||||
case ResTimerid:
|
||||
return 4
|
||||
case ResDrmCtx:
|
||||
return 4
|
||||
default:
|
||||
panic("unknown resource kind")
|
||||
}
|
||||
|
271
sys/dri.txt
271
sys/dri.txt
@ -1,9 +1,15 @@
|
||||
# Copyright 2015 syzkaller project authors. All rights reserved.
|
||||
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||
|
||||
include <drm/drm.h>
|
||||
include <drm/drm_mode.h>
|
||||
|
||||
syz_open_dev$dri(dev strconst["/dev/dri/card#"], id intptr, flags flags[open_flags]) fd[dri]
|
||||
syz_open_dev$dricontrol(dev strconst["/dev/dri/controlD#"], id intptr, flags flags[open_flags]) fd[dri]
|
||||
syz_open_dev$drirender(dev strconst["/dev/dri/renderD#"], id intptr, flags flags[open_flags]) fd[dri]
|
||||
|
||||
ioctl$DRM_IOCTL_VERSION(fd fd[dri], cmd const[DRM_IOCTL_VERSION], arg ptr[in, drm_version])
|
||||
ioctl$DRM_IOCTL_GET_UNIQUE(fd fd[dri], cmd const[DRM_IOCTL_GET_UNIQUE], arg ptr[in, drm_unique])
|
||||
ioctl$DRM_IOCTL_GET_UNIQUE(fd fd[dri], cmd const[DRM_IOCTL_GET_UNIQUE], arg ptr[in, drm_unique_out])
|
||||
ioctl$DRM_IOCTL_GET_MAGIC(fd fd[dri], cmd const[DRM_IOCTL_GET_MAGIC], arg ptr[in, int32])
|
||||
ioctl$DRM_IOCTL_IRQ_BUSID(fd fd[dri], cmd const[DRM_IOCTL_IRQ_BUSID], arg ptr[in, drm_irq_busid])
|
||||
ioctl$DRM_IOCTL_GET_MAP(fd fd[dri], cmd const[DRM_IOCTL_GET_MAP], arg ptr[in, drm_map])
|
||||
@ -12,6 +18,76 @@ ioctl$DRM_IOCTL_GET_STATS(fd fd[dri], cmd const[DRM_IOCTL_GET_STATS], arg buffer
|
||||
ioctl$DRM_IOCTL_GET_CAP(fd fd[dri], cmd const[DRM_IOCTL_GET_CAP], arg ptr[in, drm_get_cap])
|
||||
ioctl$DRM_IOCTL_SET_CLIENT_CAP(fd fd[dri], cmd const[DRM_IOCTL_SET_CLIENT_CAP], arg ptr[in, drm_get_cap])
|
||||
ioctl$DRM_IOCTL_SET_VERSION(fd fd[dri], cmd const[DRM_IOCTL_SET_VERSION], arg ptr[in, drm_set_version])
|
||||
ioctl$DRM_IOCTL_SET_UNIQUE(fd fd[dri], cmd const[DRM_IOCTL_SET_UNIQUE], arg ptr[in, drm_unique_in])
|
||||
ioctl$DRM_IOCTL_AUTH_MAGIC(fd fd[dri], cmd const[DRM_IOCTL_AUTH_MAGIC], arg ptr[in, int32])
|
||||
ioctl$DRM_IOCTL_ADD_MAP(fd fd[dri], cmd const[DRM_IOCTL_ADD_MAP], arg ptr[in, drm_map])
|
||||
ioctl$DRM_IOCTL_RM_MAP(fd fd[dri], cmd const[DRM_IOCTL_RM_MAP], arg ptr[in, drm_map])
|
||||
ioctl$DRM_IOCTL_SET_SAREA_CTX(fd fd[dri], cmd const[DRM_IOCTL_SET_SAREA_CTX], arg ptr[in, drm_ctx_priv_map])
|
||||
ioctl$DRM_IOCTL_GET_SAREA_CTX(fd fd[dri], cmd const[DRM_IOCTL_GET_SAREA_CTX], arg ptr[in, drm_ctx_priv_map])
|
||||
ioctl$DRM_IOCTL_SET_MASTER(fd fd[dri], cmd const[DRM_IOCTL_SET_MASTER])
|
||||
ioctl$DRM_IOCTL_DROP_MASTER(fd fd[dri], cmd const[DRM_IOCTL_DROP_MASTER])
|
||||
ioctl$DRM_IOCTL_ADD_CTX(fd fd[dri], cmd const[DRM_IOCTL_ADD_CTX], arg ptr[out, drm_ctx])
|
||||
ioctl$DRM_IOCTL_RM_CTX(fd fd[dri], cmd const[DRM_IOCTL_RM_CTX], arg ptr[in, drm_ctx])
|
||||
ioctl$DRM_IOCTL_GET_CTX(fd fd[dri], cmd const[DRM_IOCTL_GET_CTX], arg ptr[in, drm_ctx])
|
||||
ioctl$DRM_IOCTL_SWITCH_CTX(fd fd[dri], cmd const[DRM_IOCTL_SWITCH_CTX], arg ptr[in, drm_ctx])
|
||||
ioctl$DRM_IOCTL_NEW_CTX(fd fd[dri], cmd const[DRM_IOCTL_NEW_CTX], arg ptr[in, drm_ctx])
|
||||
ioctl$DRM_IOCTL_RES_CTX(fd fd[dri], cmd const[DRM_IOCTL_RES_CTX], arg ptr[in, drm_ctx_res])
|
||||
ioctl$DRM_IOCTL_LOCK(fd fd[dri], cmd const[DRM_IOCTL_LOCK], arg ptr[in, drm_lock])
|
||||
ioctl$DRM_IOCTL_UNLOCK(fd fd[dri], cmd const[DRM_IOCTL_UNLOCK], arg ptr[in, drm_lock])
|
||||
ioctl$DRM_IOCTL_ADD_BUFS(fd fd[dri], cmd const[DRM_IOCTL_ADD_BUFS], arg ptr[in, drm_buf_desc])
|
||||
ioctl$DRM_IOCTL_MARK_BUFS(fd fd[dri], cmd const[DRM_IOCTL_MARK_BUFS], arg ptr[in, drm_buf_desc])
|
||||
ioctl$DRM_IOCTL_INFO_BUFS(fd fd[dri], cmd const[DRM_IOCTL_INFO_BUFS], arg ptr[in, drm_buf_desc])
|
||||
ioctl$DRM_IOCTL_MAP_BUFS(fd fd[dri], cmd const[DRM_IOCTL_MAP_BUFS], arg ptr[in, drm_buf_map])
|
||||
ioctl$DRM_IOCTL_FREE_BUFS(fd fd[dri], cmd const[DRM_IOCTL_FREE_BUFS], arg ptr[in, drm_buf_free])
|
||||
ioctl$DRM_IOCTL_DMA(fd fd[dri], cmd const[DRM_IOCTL_DMA], arg ptr[in, drm_dma])
|
||||
ioctl$DRM_IOCTL_CONTROL(fd fd[dri], cmd const[DRM_IOCTL_CONTROL], arg ptr[in, drm_control])
|
||||
ioctl$DRM_IOCTL_AGP_ACQUIRE(fd fd[dri], cmd const[DRM_IOCTL_AGP_ACQUIRE])
|
||||
ioctl$DRM_IOCTL_AGP_RELEASE(fd fd[dri], cmd const[DRM_IOCTL_AGP_RELEASE])
|
||||
ioctl$DRM_IOCTL_AGP_ENABLE(fd fd[dri], cmd const[DRM_IOCTL_AGP_ENABLE], arg ptr[in, int32])
|
||||
ioctl$DRM_IOCTL_AGP_INFO(fd fd[dri], cmd const[DRM_IOCTL_AGP_INFO], arg buffer[out])
|
||||
ioctl$DRM_IOCTL_AGP_ALLOC(fd fd[dri], cmd const[DRM_IOCTL_AGP_ALLOC], arg ptr[in, drm_agp_buffer])
|
||||
ioctl$DRM_IOCTL_AGP_FREE(fd fd[dri], cmd const[DRM_IOCTL_AGP_FREE], arg ptr[in, drm_agp_buffer])
|
||||
ioctl$DRM_IOCTL_AGP_BIND(fd fd[dri], cmd const[DRM_IOCTL_AGP_BIND], arg ptr[in, drm_agp_binding])
|
||||
ioctl$DRM_IOCTL_AGP_UNBIND(fd fd[dri], cmd const[DRM_IOCTL_AGP_UNBIND], arg ptr[in, drm_agp_binding])
|
||||
ioctl$DRM_IOCTL_SG_ALLOC(fd fd[dri], cmd const[DRM_IOCTL_SG_ALLOC], arg ptr[in, drm_scatter_gather])
|
||||
ioctl$DRM_IOCTL_SG_FREE(fd fd[dri], cmd const[DRM_IOCTL_SG_FREE], arg ptr[in, drm_scatter_gather])
|
||||
ioctl$DRM_IOCTL_WAIT_VBLANK(fd fd[dri], cmd const[DRM_IOCTL_WAIT_VBLANK], arg ptr[in, drm_wait_vblank])
|
||||
ioctl$DRM_IOCTL_MODESET_CTL(fd fd[dri], cmd const[DRM_IOCTL_MODESET_CTL], arg ptr[in, drm_modeset_ctl])
|
||||
ioctl$DRM_IOCTL_GEM_CLOSE(fd fd[dri], cmd const[DRM_IOCTL_GEM_CLOSE], arg ptr[in, drm_gem_close])
|
||||
ioctl$DRM_IOCTL_GEM_FLINK(fd fd[dri], cmd const[DRM_IOCTL_GEM_FLINK], arg ptr[in, drm_gem_flink])
|
||||
ioctl$DRM_IOCTL_GEM_OPEN(fd fd[dri], cmd const[DRM_IOCTL_GEM_OPEN], arg ptr[in, drm_gem_open])
|
||||
ioctl$DRM_IOCTL_MODE_GETRESOURCES(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETRESOURCES], arg ptr[in, drm_mode_card_res])
|
||||
ioctl$DRM_IOCTL_PRIME_HANDLE_TO_FD(fd fd[dri], cmd const[DRM_IOCTL_PRIME_HANDLE_TO_FD], arg ptr[in, drm_prime_handle])
|
||||
ioctl$DRM_IOCTL_PRIME_FD_TO_HANDLE(fd fd[dri], cmd const[DRM_IOCTL_PRIME_FD_TO_HANDLE], arg ptr[in, drm_prime_handle])
|
||||
ioctl$DRM_IOCTL_MODE_GETPLANERESOURCES(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETPLANERESOURCES], arg ptr[in, drm_mode_get_plane_res])
|
||||
ioctl$DRM_IOCTL_MODE_GETCRTC(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETCRTC], arg ptr[in, drm_mode_crtc])
|
||||
ioctl$DRM_IOCTL_MODE_SETCRTC(fd fd[dri], cmd const[DRM_IOCTL_MODE_SETCRTC], arg ptr[in, drm_mode_crtc])
|
||||
|
||||
#ioctl$DRM_IOCTL_MODE_GETPLANE(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETPLANE], arg ptr[in, drm_mode_get_plane])
|
||||
#ioctl$DRM_IOCTL_MODE_SETPLANE(fd fd[dri], cmd const[DRM_IOCTL_MODE_SETPLANE], arg ptr[in, drm_mode_set_plane])
|
||||
#ioctl$DRM_IOCTL_MODE_CURSOR(fd fd[dri], cmd const[DRM_IOCTL_MODE_CURSOR], arg ptr[in, drm_mode_cursor])
|
||||
#ioctl$DRM_IOCTL_MODE_GETGAMMA(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETGAMMA], arg ptr[in, drm_mode_crtc_lut])
|
||||
#ioctl$DRM_IOCTL_MODE_SETGAMMA(fd fd[dri], cmd const[DRM_IOCTL_MODE_SETGAMMA], arg ptr[in, drm_mode_crtc_lut])
|
||||
#ioctl$DRM_IOCTL_MODE_GETENCODER(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETENCODER], arg ptr[in, drm_mode_get_encoder])
|
||||
#ioctl$DRM_IOCTL_MODE_GETCONNECTOR(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETCONNECTOR], arg ptr[in, drm_mode_get_connector])
|
||||
#ioctl$DRM_IOCTL_MODE_GETPROPERTY(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETPROPERTY], arg ptr[in, drm_mode_get_property])
|
||||
#ioctl$DRM_IOCTL_MODE_SETPROPERTY(fd fd[dri], cmd const[DRM_IOCTL_MODE_SETPROPERTY], arg ptr[in, drm_mode_connector_set_property])
|
||||
#ioctl$DRM_IOCTL_MODE_GETPROPBLOB(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETPROPBLOB], arg ptr[in, drm_mode_get_blob])
|
||||
#ioctl$DRM_IOCTL_MODE_GETFB(fd fd[dri], cmd const[DRM_IOCTL_MODE_GETFB], arg ptr[in, drm_mode_fb_cmd])
|
||||
#ioctl$DRM_IOCTL_MODE_ADDFB(fd fd[dri], cmd const[DRM_IOCTL_MODE_ADDFB], arg ptr[in, drm_mode_fb_cmd])
|
||||
#ioctl$DRM_IOCTL_MODE_ADDFB2(fd fd[dri], cmd const[DRM_IOCTL_MODE_ADDFB2], arg ptr[in, drm_mode_fb_cmd2])
|
||||
#ioctl$DRM_IOCTL_MODE_RMFB(fd fd[dri], cmd const[DRM_IOCTL_MODE_RMFB], arg ptr[in, int32])
|
||||
#ioctl$DRM_IOCTL_MODE_PAGE_FLIP(fd fd[dri], cmd const[DRM_IOCTL_MODE_PAGE_FLIP], arg ptr[in, drm_mode_crtc_page_flip])
|
||||
#ioctl$DRM_IOCTL_MODE_DIRTYFB(fd fd[dri], cmd const[DRM_IOCTL_MODE_DIRTYFB], arg ptr[in, drm_mode_fb_dirty_cmd])
|
||||
#ioctl$DRM_IOCTL_MODE_CREATE_DUMB(fd fd[dri], cmd const[DRM_IOCTL_MODE_CREATE_DUMB], arg ptr[in, drm_mode_create_dumb])
|
||||
#ioctl$DRM_IOCTL_MODE_MAP_DUMB(fd fd[dri], cmd const[DRM_IOCTL_MODE_MAP_DUMB], arg ptr[in, drm_mode_map_dumb])
|
||||
#ioctl$DRM_IOCTL_MODE_DESTROY_DUMB(fd fd[dri], cmd const[DRM_IOCTL_MODE_DESTROY_DUMB], arg ptr[in, drm_mode_destroy_dumb])
|
||||
#ioctl$DRM_IOCTL_MODE_OBJ_GETPROPERTIES(fd fd[dri], cmd const[DRM_IOCTL_MODE_OBJ_GETPROPERTIES], arg ptr[in, drm_mode_obj_get_properties])
|
||||
#ioctl$DRM_IOCTL_MODE_OBJ_SETPROPERTY(fd fd[dri], cmd const[DRM_IOCTL_MODE_OBJ_SETPROPERTY], arg ptr[in, drm_mode_obj_set_property])
|
||||
#ioctl$DRM_IOCTL_MODE_CURSOR2(fd fd[dri], cmd const[DRM_IOCTL_MODE_CURSOR2], arg ptr[in, drm_mode_cursor2])
|
||||
#ioctl$DRM_IOCTL_MODE_ATOMIC(fd fd[dri], cmd const[DRM_IOCTL_MODE_ATOMIC], arg ptr[in, drm_mode_atomic])
|
||||
#ioctl$DRM_IOCTL_MODE_CREATEPROPBLOB(fd fd[dri], cmd const[DRM_IOCTL_MODE_CREATEPROPBLOB], arg ptr[in, drm_mode_create_blob])
|
||||
#ioctl$DRM_IOCTL_MODE_DESTROYPROPBLOB(fd fd[dri], cmd const[DRM_IOCTL_MODE_DESTROYPROPBLOB], arg ptr[in, drm_mode_destroy_blob])
|
||||
|
||||
drm_version {
|
||||
maj int32
|
||||
@ -25,7 +101,12 @@ drm_version {
|
||||
desc buffer[out]
|
||||
}
|
||||
|
||||
drm_unique {
|
||||
drm_unique_in {
|
||||
len len[uni, intptr]
|
||||
uni buffer[in]
|
||||
}
|
||||
|
||||
drm_unique_out {
|
||||
len len[uni, intptr]
|
||||
uni buffer[out]
|
||||
}
|
||||
@ -38,7 +119,7 @@ drm_irq_busid {
|
||||
}
|
||||
|
||||
drm_map {
|
||||
off intptr
|
||||
off vma[opt]
|
||||
size intptr
|
||||
type flags[drm_map_type, int32]
|
||||
flags flags[drm_map_flags, int32]
|
||||
@ -71,6 +152,190 @@ drm_set_version {
|
||||
dd_min int32
|
||||
}
|
||||
|
||||
drm_ctx_priv_map {
|
||||
ctxid drmctx
|
||||
handle buffer[out]
|
||||
}
|
||||
|
||||
drm_ctx {
|
||||
handle drmctx
|
||||
flags flags[drm_ctx_flags, int32]
|
||||
}
|
||||
|
||||
drm_ctx_res {
|
||||
count len[context, int32]
|
||||
context ptr[out, array[drm_ctx]]
|
||||
}
|
||||
|
||||
drm_lock {
|
||||
context drmctx
|
||||
flags flags[drm_lock_flags, int32]
|
||||
}
|
||||
|
||||
drm_buf_desc {
|
||||
count int32
|
||||
size int32
|
||||
lomark int32
|
||||
himark int32
|
||||
flags flags[drm_buf_flags, int32]
|
||||
# TODO: what is agp addresses? should it be a special type?
|
||||
agpaddr intptr
|
||||
}
|
||||
|
||||
drm_buf_map {
|
||||
count len[list, int32]
|
||||
virtual buffer[out]
|
||||
list ptr[in, array[drm_buf_pub]]
|
||||
}
|
||||
|
||||
drm_buf_pub {
|
||||
idx int32
|
||||
total len[addr, int32]
|
||||
used int32
|
||||
addr buffer[out]
|
||||
}
|
||||
|
||||
drm_buf_free {
|
||||
count len[list, int32]
|
||||
list ptr[in, array[int32]]
|
||||
}
|
||||
|
||||
drm_dma {
|
||||
context drmctx
|
||||
sendcnt len[sendind, int32]
|
||||
sendind ptr[in, array[int32]]
|
||||
sendsiz ptr[in, array[int32]]
|
||||
flags flags[drm_dma_flags, int32]
|
||||
reqcnd len[reqind, int32]
|
||||
reqsiz0 int32
|
||||
reqind ptr[in, array[int32]]
|
||||
reqsiz ptr[in, array[int32]]
|
||||
granted const[0, int32]
|
||||
}
|
||||
|
||||
drm_control {
|
||||
func flags[drm_control_type, int32]
|
||||
irq int32
|
||||
}
|
||||
|
||||
drm_agp_buffer {
|
||||
size intptr
|
||||
# TODO: Probably needs to be a resource.
|
||||
handle intptr
|
||||
type intptr
|
||||
# TODO: Physical i810 address probably needs to be a resource.
|
||||
physic intptr
|
||||
}
|
||||
|
||||
drm_agp_binding {
|
||||
# TODO: this comes from drm_agp_buffer.handle
|
||||
handle intptr
|
||||
offset intptr
|
||||
}
|
||||
|
||||
drm_scatter_gather {
|
||||
size intptr
|
||||
# TODO: probably also comes from drm_agp_buffer.handle
|
||||
handle intptr
|
||||
}
|
||||
|
||||
drm_wait_vblank {
|
||||
type flags[drm_vblank_seq_type, int32]
|
||||
seq int32
|
||||
signal signalno
|
||||
}
|
||||
|
||||
drm_modeset_ctl {
|
||||
crtc int32
|
||||
cmd int32
|
||||
}
|
||||
|
||||
drm_gem_close {
|
||||
# TODO: give it a separate type.
|
||||
handle int32
|
||||
pad const[0, int32]
|
||||
}
|
||||
|
||||
drm_gem_flink {
|
||||
handle int32
|
||||
name int32
|
||||
}
|
||||
|
||||
drm_gem_open {
|
||||
name int32
|
||||
# TODO: this create handle
|
||||
handle int32
|
||||
size int64
|
||||
}
|
||||
|
||||
drm_mode_card_res {
|
||||
fbid ptr[out, array[int32]]
|
||||
crtcid ptr[out, array[int32]]
|
||||
connid ptr[out, array[int32]]
|
||||
encid ptr[out, array[int32]]
|
||||
nfbid len[fbid, int32]
|
||||
ncrtcid len[crtcid, int32]
|
||||
nconnid len[connid, int32]
|
||||
nencid len[encid, int32]
|
||||
maxw const[0, int32]
|
||||
maxh const[0, int32]
|
||||
minw const[0, int32]
|
||||
minh const[0, int32]
|
||||
}
|
||||
|
||||
drm_prime_handle {
|
||||
# TODO: handle of what?
|
||||
handle int32
|
||||
flags flags[dup_flags, int32]
|
||||
fd fd
|
||||
}
|
||||
|
||||
drm_mode_get_plane_res {
|
||||
ids ptr[out, array[int32]]
|
||||
cnt len[ids, int32]
|
||||
}
|
||||
|
||||
drm_mode_crtc {
|
||||
connect ptr[in, array[int32]]
|
||||
cnt len[connect, int32]
|
||||
crtcid int32
|
||||
x int32
|
||||
y int32
|
||||
gamma int32
|
||||
valid int32
|
||||
mode drm_mode_modeinfo
|
||||
}
|
||||
|
||||
drm_mode_modeinfo {
|
||||
clock int32
|
||||
hdisp int16
|
||||
hsyncs int16
|
||||
hsynce int16
|
||||
htotal int16
|
||||
hskew int16
|
||||
vdisp int16
|
||||
vsyncs int16
|
||||
vsynce int16
|
||||
vtotal int16
|
||||
vscan int16
|
||||
vrefr int16
|
||||
flag int32
|
||||
type int32
|
||||
name array[int8, DRM_DISPLAY_MODE_LEN]
|
||||
}
|
||||
|
||||
drm_map_type = _DRM_FRAME_BUFFER, _DRM_REGISTERS, _DRM_SHM, _DRM_AGP, _DRM_SCATTER_GATHER, _DRM_CONSISTENT
|
||||
drm_map_flags = _DRM_RESTRICTED, _DRM_READ_ONLY, _DRM_LOCKED, _DRM_KERNEL, _DRM_WRITE_COMBINING, _DRM_CONTAINS_LOCK, _DRM_REMOVABLE, _DRM_DRIVER
|
||||
drm_ctx_flags = _DRM_CONTEXT_PRESERVED, _DRM_CONTEXT_2DONLY
|
||||
drm_lock_flags = _DRM_LOCK_READY, _DRM_LOCK_QUIESCENT, _DRM_LOCK_FLUSH, _DRM_LOCK_FLUSH_ALL, _DRM_HALT_ALL_QUEUES, _DRM_HALT_CUR_QUEUES
|
||||
drm_buf_flags = _DRM_PAGE_ALIGN, _DRM_AGP_BUFFER, _DRM_SG_BUFFER, _DRM_FB_BUFFER, _DRM_PCI_BUFFER_RO
|
||||
drm_dma_flags = _DRM_DMA_BLOCK, _DRM_DMA_WHILE_LOCKED, _DRM_DMA_PRIORITY, _DRM_DMA_WAIT, _DRM_DMA_SMALLER_OK, _DRM_DMA_LARGER_OK
|
||||
drm_control_type = DRM_ADD_COMMAND, DRM_RM_COMMAND, DRM_INST_HANDLER, DRM_UNINST_HANDLER
|
||||
drm_vblank_seq_type = _DRM_VBLANK_ABSOLUTE, _DRM_VBLANK_RELATIVE, _DRM_VBLANK_HIGH_CRTC_MASK, _DRM_VBLANK_EVENT, _DRM_VBLANK_FLIP, _DRM_VBLANK_NEXTONMISS, _DRM_VBLANK_SECONDARY, _DRM_VBLANK_SIGNAL
|
||||
|
||||
# TODO: all manually IO defines that use fake int size generate wrong ioctl numbers,
|
||||
# because size is part of ioctl number. We really need to somehow use headers from linux sources.
|
||||
define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, int)
|
||||
define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, int)
|
||||
define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, int)
|
||||
|
||||
|
682
sys/sys.go
682
sys/sys.go
File diff suppressed because one or more lines are too long
@ -102,7 +102,6 @@ include <netinet/in.h>
|
||||
include <netinet/ip.h>
|
||||
include <netinet/tcp.h>
|
||||
include <netinet/udp.h>
|
||||
include <drm/drm.h>
|
||||
|
||||
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
package sys
|
||||
|
||||
// Maps internal syscall ID onto kernel syscall number.
|
||||
var numbers = []int{2, 2, 257, 85, 3, 0, 17, 19, 295, 1, 18, 20, 296, 8, 32, 33, 292, 22, 293, 276, 275, 278, 40, 4, 6, 5, 7, 271, 23, 270, 213, 291, 233, 232, 281, 282, 289, 284, 290, 283, 286, 287, 323, 16, 16, 16, 16, 16, 16, 9, 11, 25, 216, 10, 26, 28, 221, 187, 237, 279, 256, 238, 239, 27, 149, 325, 150, 151, 152, 319, 272, 312, 202, 273, 274, 219, 16, 16, 16, 16, 16, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 206, 207, 208, 209, 210, 125, 126, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 317, 240, 242, 243, 244, 245, 241, 68, 69, 70, 71, 64, 65, 220, 66, 29, 30, 31, 67, 133, 259, 90, 91, 268, 92, 94, 93, 260, 285, 269, 132, 235, 261, 280, 104, 108, 105, 106, 102, 107, 109, 121, 111, 39, 186, 113, 114, 117, 119, 118, 120, 122, 123, 115, 116, 135, 253, 294, 254, 255, 300, 301, 86, 265, 266, 88, 87, 263, 89, 267, 82, 264, 316, 83, 258, 84, 76, 77, 73, 74, 75, 162, 306, 277, 212, 78, 217, 303, 304, 165, 165, 166, 155, 139, 139, 139, 137, 138, 134, 175, 313, 176, 246, 177, 103, 63, 99, 136, 163, 98, 97, 160, 302, 172, 173, 252, 252, 251, 251, 308, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 228, 227, 305, 229, 230, 222, 224, 225, 223, 226, 13, 14, 15, 127, 128, 130, 129, 297, 131, 234, 200, 34, 37, 35, 36, 38, 60, 231, 247, 61, 100, 205, 211, 154, 154, 154, 154, 310, 311, 218, 140, 141, 145, 144, 148, 143, 142, 204, 203, 315, 314, 24, 318, 324, 41, 53, 43, 288, 49, 50, 42, 48, 44, 46, 307, 45, 47, 299, 51, 52, 55, 54, 16, 16, 54, 55, 54, 54, 55, 54, 55, 54, 55, 54, 54, 54, 55, 54, 55, 55, 54, 55, 54, 55, 54, 55, 54, 55, 55, 54, 55, 54, 55, 54, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 41, 53, 49, 42, 43, 288, 44, 46, 307, 45, 51, 52, 41, 49, 54, 54, 43, 46, 307, 41, 49, 42, 43, 54, 54, 55, 46, 307, 41, 42, 41, 49, 16, 54, 54, 54, 55, 41, 49, 42, 55, 55, 41, 49, 42, 54, 55, 54, 55, 54, 55, 41, 49, 42, 54, 55, 55, 41, 16, 16, 16, 16, 41, 16, 16, 16, 16, 41, 16, 16, 16, 16, 16, 16, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 2, 1000002, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 298, 16, 16, 16, 16, 16, 16, 16, 16, 16, 248, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 1000003, 1000004, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 41, 41, 53, 49, 42, 43, 288, 44, 46, 307, 45, 51, 52, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 1000001, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 1000001, 1000001, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}
|
||||
var numbers = []int{2, 2, 257, 85, 3, 0, 17, 19, 295, 1, 18, 20, 296, 8, 32, 33, 292, 22, 293, 276, 275, 278, 40, 4, 6, 5, 7, 271, 23, 270, 213, 291, 233, 232, 281, 282, 289, 284, 290, 283, 286, 287, 323, 16, 16, 16, 16, 16, 16, 9, 11, 25, 216, 10, 26, 28, 221, 187, 237, 279, 256, 238, 239, 27, 149, 325, 150, 151, 152, 319, 272, 312, 202, 273, 274, 219, 16, 16, 16, 16, 16, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 206, 207, 208, 209, 210, 125, 126, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 317, 240, 242, 243, 244, 245, 241, 68, 69, 70, 71, 64, 65, 220, 66, 29, 30, 31, 67, 133, 259, 90, 91, 268, 92, 94, 93, 260, 285, 269, 132, 235, 261, 280, 104, 108, 105, 106, 102, 107, 109, 121, 111, 39, 186, 113, 114, 117, 119, 118, 120, 122, 123, 115, 116, 135, 253, 294, 254, 255, 300, 301, 86, 265, 266, 88, 87, 263, 89, 267, 82, 264, 316, 83, 258, 84, 76, 77, 73, 74, 75, 162, 306, 277, 212, 78, 217, 303, 304, 165, 165, 166, 155, 139, 139, 139, 137, 138, 134, 175, 313, 176, 246, 177, 103, 63, 99, 136, 163, 98, 97, 160, 302, 172, 173, 252, 252, 251, 251, 308, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 228, 227, 305, 229, 230, 222, 224, 225, 223, 226, 13, 14, 15, 127, 128, 130, 129, 297, 131, 234, 200, 34, 37, 35, 36, 38, 60, 231, 247, 61, 100, 205, 211, 154, 154, 154, 154, 310, 311, 218, 140, 141, 145, 144, 148, 143, 142, 204, 203, 315, 314, 24, 318, 324, 41, 53, 43, 288, 49, 50, 42, 48, 44, 46, 307, 45, 47, 299, 51, 52, 55, 54, 16, 16, 54, 55, 54, 54, 55, 54, 55, 54, 55, 54, 54, 54, 55, 54, 55, 55, 54, 55, 54, 55, 54, 55, 54, 55, 55, 54, 55, 54, 55, 54, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 41, 53, 49, 42, 43, 288, 44, 46, 307, 45, 51, 52, 41, 49, 54, 54, 43, 46, 307, 41, 49, 42, 43, 54, 54, 55, 46, 307, 41, 42, 41, 49, 16, 54, 54, 54, 55, 41, 49, 42, 55, 55, 41, 49, 42, 54, 55, 54, 55, 54, 55, 41, 49, 42, 54, 55, 55, 41, 16, 16, 16, 16, 41, 16, 16, 16, 16, 41, 16, 16, 16, 16, 16, 16, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 54, 55, 2, 1000002, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 298, 16, 16, 16, 16, 16, 16, 16, 16, 16, 248, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 1000003, 1000004, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1000001, 1000001, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 41, 41, 53, 49, 42, 43, 288, 44, 46, 307, 45, 51, 52, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 1000001, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1000001, 1000001, 1000001, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}
|
||||
|
@ -2,4 +2,4 @@
|
||||
package sys
|
||||
|
||||
// Maps internal syscall ID onto kernel syscall number.
|
||||
var numbers = []int{-1, -1, 56, -1, 57, 63, 67, 65, 69, 64, 68, 66, 70, 62, 23, -1, 24, -1, 59, 77, 76, 75, 71, -1, -1, 80, -1, 73, -1, 72, -1, 20, 21, -1, 22, -1, 74, -1, 19, 85, 86, 87, -1, 29, 29, 29, 29, 29, 29, 222, 215, 216, 234, 226, 227, 233, 223, 213, 235, 239, 238, 237, 236, 232, 228, -1, 229, 230, 231, -1, 97, 272, 98, 99, 100, 128, 29, 29, 29, 29, 29, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 0, 1, 4, 2, 3, 90, 91, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, -1, 277, 180, 182, 183, 184, 185, 181, 186, 189, 188, 187, 190, 193, 192, 191, 194, 196, 195, 197, -1, 33, -1, 52, 53, -1, -1, 55, 54, 47, 48, -1, -1, -1, 88, 176, 177, 146, 144, 174, 175, 154, 155, -1, 172, 178, 145, 143, 147, 149, 148, 150, 151, 152, 158, 159, 92, -1, 26, 27, 28, 262, 263, -1, 37, 36, -1, -1, 35, -1, 78, -1, 38, 276, -1, 34, -1, 45, 46, 32, 82, 83, 81, 267, 84, 18, -1, 61, 264, 265, 40, 40, 39, 41, -1, -1, -1, 43, 44, -1, 105, 273, 106, 104, -1, 116, 160, 179, -1, 89, 165, 163, 164, 261, -1, -1, 31, 31, 30, 30, 268, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, 113, 112, 266, 114, 115, 107, 108, 109, 110, 111, 134, 135, 139, 136, 137, 133, 138, 240, 132, 131, 130, -1, -1, 101, 102, 103, 93, 94, 95, 260, 153, -1, -1, -1, -1, -1, -1, 270, 271, 96, 141, 140, 120, 119, 127, 121, 118, 123, 122, 275, 274, 124, -1, -1, 198, 199, 202, 242, 200, 201, 203, 210, 206, 211, 269, 207, 212, 243, 204, 205, 209, 208, 29, 29, 208, 209, 208, 208, 209, 208, 209, 208, 209, 208, 208, 208, 209, 208, 209, 209, 208, 209, 208, 209, 208, 209, 208, 209, 209, 208, 209, 208, 209, 208, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 198, 199, 200, 203, 202, 242, 206, 211, 269, 207, 204, 205, 198, 200, 208, 208, 202, 211, 269, 198, 200, 203, 202, 208, 208, 209, 211, 269, 198, 203, 198, 200, 29, 208, 208, 208, 209, 198, 200, 203, 209, 209, 198, 200, 203, 208, 209, 208, 209, 208, 209, 198, 200, 203, 208, 209, 209, 198, 29, 29, 29, 29, 198, 29, 29, 29, 29, 198, 29, 29, 29, 29, 29, 29, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, -1, 1000002, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 241, 29, 29, 29, 29, 29, 29, 29, 29, 29, 217, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000003, 1000004, 29, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -1, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 198, 198, 199, 200, 203, 202, 242, 206, 211, 269, 207, 204, 205, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -1, 1000001, 64, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 1000001, 1000001, 64, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29}
|
||||
var numbers = []int{-1, -1, 56, -1, 57, 63, 67, 65, 69, 64, 68, 66, 70, 62, 23, -1, 24, -1, 59, 77, 76, 75, 71, -1, -1, 80, -1, 73, -1, 72, -1, 20, 21, -1, 22, -1, 74, -1, 19, 85, 86, 87, -1, 29, 29, 29, 29, 29, 29, 222, 215, 216, 234, 226, 227, 233, 223, 213, 235, 239, 238, 237, 236, 232, 228, -1, 229, 230, 231, -1, 97, 272, 98, 99, 100, 128, 29, 29, 29, 29, 29, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 0, 1, 4, 2, 3, 90, 91, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, -1, 277, 180, 182, 183, 184, 185, 181, 186, 189, 188, 187, 190, 193, 192, 191, 194, 196, 195, 197, -1, 33, -1, 52, 53, -1, -1, 55, 54, 47, 48, -1, -1, -1, 88, 176, 177, 146, 144, 174, 175, 154, 155, -1, 172, 178, 145, 143, 147, 149, 148, 150, 151, 152, 158, 159, 92, -1, 26, 27, 28, 262, 263, -1, 37, 36, -1, -1, 35, -1, 78, -1, 38, 276, -1, 34, -1, 45, 46, 32, 82, 83, 81, 267, 84, 18, -1, 61, 264, 265, 40, 40, 39, 41, -1, -1, -1, 43, 44, -1, 105, 273, 106, 104, -1, 116, 160, 179, -1, 89, 165, 163, 164, 261, -1, -1, 31, 31, 30, 30, 268, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, 113, 112, 266, 114, 115, 107, 108, 109, 110, 111, 134, 135, 139, 136, 137, 133, 138, 240, 132, 131, 130, -1, -1, 101, 102, 103, 93, 94, 95, 260, 153, -1, -1, -1, -1, -1, -1, 270, 271, 96, 141, 140, 120, 119, 127, 121, 118, 123, 122, 275, 274, 124, -1, -1, 198, 199, 202, 242, 200, 201, 203, 210, 206, 211, 269, 207, 212, 243, 204, 205, 209, 208, 29, 29, 208, 209, 208, 208, 209, 208, 209, 208, 209, 208, 208, 208, 209, 208, 209, 209, 208, 209, 208, 209, 208, 209, 208, 209, 209, 208, 209, 208, 209, 208, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 198, 199, 200, 203, 202, 242, 206, 211, 269, 207, 204, 205, 198, 200, 208, 208, 202, 211, 269, 198, 200, 203, 202, 208, 208, 209, 211, 269, 198, 203, 198, 200, 29, 208, 208, 208, 209, 198, 200, 203, 209, 209, 198, 200, 203, 208, 209, 208, 209, 208, 209, 198, 200, 203, 208, 209, 209, 198, 29, 29, 29, 29, 198, 29, 29, 29, 29, 198, 29, 29, 29, 29, 29, 29, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, 208, 209, -1, 1000002, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 241, 29, 29, 29, 29, 29, 29, 29, 29, 29, 217, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000003, 1000004, 29, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 1000001, 1000001, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -1, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 198, 198, 199, 200, 203, 202, 242, 206, 211, 269, 207, 204, 205, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -1, 1000001, 64, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 1000001, 1000001, 1000001, 64, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29}
|
||||
|
@ -160,6 +160,11 @@ func generateArg(name, typ string, a []string, structs map[string]Struct, unname
|
||||
failf("wrong number of arguments for %v arg %v want %v, got %v", typ, name, want, len(a))
|
||||
}
|
||||
fmt.Fprintf(out, "ResourceType{%v, Kind: ResGid}", common())
|
||||
case "drmctx":
|
||||
if want := 0; len(a) != want {
|
||||
failf("wrong number of arguments for %v arg %v want %v, got %v", typ, name, want, len(a))
|
||||
}
|
||||
fmt.Fprintf(out, "ResourceType{%v, Kind: ResDrmCtx}", common())
|
||||
case "fileoff":
|
||||
var size uint64
|
||||
if isField {
|
||||
@ -303,7 +308,10 @@ func generateArg(name, typ string, a []string, structs map[string]Struct, unname
|
||||
}
|
||||
sz := "0"
|
||||
if len(a) == 2 {
|
||||
sz = a[1]
|
||||
sz = flagVals[a[1]]
|
||||
if sz == "" {
|
||||
sz = a[1]
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(out, "ArrayType{%v, Type: %v, Len: %v}", common(), generateType(a[0], structs, unnamed, flags, flagVals), sz)
|
||||
case "ptr":
|
||||
@ -723,11 +731,17 @@ func parseType1(p *Parser, unnamed map[string][]string, flags map[string][]strin
|
||||
}
|
||||
p.Parse(']')
|
||||
}
|
||||
if name == "const" && len(typ) == 2 {
|
||||
if name == "const" && len(typ) > 1 {
|
||||
// Create a fake flag with the const value.
|
||||
id := fmt.Sprintf("const_flag_%v", constSeq)
|
||||
constSeq++
|
||||
flags[id] = typ[1:]
|
||||
flags[id] = typ[1:2]
|
||||
}
|
||||
if name == "array" && len(typ) > 2 {
|
||||
// Create a fake flag with the const value.
|
||||
id := fmt.Sprintf("const_flag_%v", constSeq)
|
||||
constSeq++
|
||||
flags[id] = typ[2:3]
|
||||
}
|
||||
return typ
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user