interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / linux / aien-gpu / aien_gpu_uapi.h

32 lines · 1244 bytes Raw Blame History
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/* aien_gpu_uapi.h: the /dev/aien-gpu interface, shared by the module (aien_gpu.c) and its user-space tools
3 * (aien_gpu_check.c, aien_gsp_boot.c). L332 rung 2. */
4#ifndef AIEN_GPU_UAPI_H
5#define AIEN_GPU_UAPI_H
6
7#include <linux/ioctl.h>
8#include <linux/types.h>
9
10struct aien_gpu_info {
11 __u32 boot0, boot42;
12 __u64 bar0_bytes;
13 __u64 arena_bytes, arena_iova; /* mmap offset 0 of /dev/aien-gpu */
14 __u64 fw_bytes;
15 __u32 fw_ok, dma_bits;
16 __u64 heap_bytes, heap_iova; /* GSP sysmem heap: chip only, not mapped to user space */
17 __u32 allow_boot, doorbells; /* doorbells: SEC2 QUEUE_HEAD(0) writes so far (at most 1 per load) */
18 __u64 bar0_pa;
19};
20
21/* One 32-bit BAR0 register. Only the GSP start-up registers of gpu/contract/gb10_gsp.devc (plus the two
22 * identity registers, for reads) are reachable; anything else is -EPERM. Writes need allow_boot=1 and
23 * CAP_SYS_RAWIO. After remove, INFO and register ioctls return -ENODEV. */
24struct aien_gpu_reg {
25 __u32 off, val;
26};
27
28#define AIEN_GPU_INFO _IOR('A', 0x01, struct aien_gpu_info)
29#define AIEN_GPU_REG_RD _IOWR('A', 0x02, struct aien_gpu_reg)
30#define AIEN_GPU_REG_WR _IOW('A', 0x03, struct aien_gpu_reg)
31
32#endif