Sha256: 609d09dd491cecb01121532761e2c9d6d26298ad46450546078ea979e26ad404

Contents?: true

Size: 749 Bytes

Versions: 21

Compression:

Stored size: 749 Bytes

Contents

/* SPDX-License-Identifier: MIT */

#ifndef LIBURING_ARCH_AARCH64_LIB_H
#define LIBURING_ARCH_AARCH64_LIB_H

#include <elf.h>
#include <sys/auxv.h>
#include "../../syscall.h"

static inline long __get_page_size(void)
{
	Elf64_Off buf[2];
	long ret = 4096;
	int fd;

	fd = __sys_open("/proc/self/auxv", O_RDONLY, 0);
	if (fd < 0)
		return ret;

	while (1) {
		ssize_t x;

		x = __sys_read(fd, buf, sizeof(buf));
		if (x < sizeof(buf))
			break;

		if (buf[0] == AT_PAGESZ) {
			ret = buf[1];
			break;
		}
	}

	__sys_close(fd);
	return ret;
}

static inline long get_page_size(void)
{
	static long cache_val;

	if (cache_val)
		return cache_val;

	cache_val = __get_page_size();
	return cache_val;
}

#endif /* #ifndef LIBURING_ARCH_AARCH64_LIB_H */

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
polyphony-1.5 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.4 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.3 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.2.1 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.2 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.1.1 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.1 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.0.2 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.0.1 vendor/liburing/src/arch/aarch64/lib.h
polyphony-1.0 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.6 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.5 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.4 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.3 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.2 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99.1 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.99 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.98 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.97 vendor/liburing/src/arch/aarch64/lib.h
polyphony-0.96 vendor/liburing/src/arch/aarch64/lib.h