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 / kernel / gpu / amd_host_shim.h

17 lines · 578 bytes Raw Blame History
1/* native/kernel/gpu/amd_host_shim.h -- host test only (AMD_GPU_TEST_HOST).
2 *
3 * amd_gpu.h takes two x86 instructions from x86/x86.h (rdtsc and pause). The
4 * host test runs on any build machine, so it gets portable stand-ins here
5 * instead. The test sets tsc_hz to 1e9, so one "tick" is one nanosecond. */
6#pragma once
7#include <stdint.h>
8#include <time.h>
9
10static inline uint64_t ck_rdtsc(void)
11{
12 struct timespec ts;
13 clock_gettime(CLOCK_MONOTONIC, &ts);
14 return (uint64_t)ts.tv_sec * 1000000000ull + (uint64_t)ts.tv_nsec;
15}
16
17static inline void ck_pause(void) { }