mailing list of musl libc
 help / color / mirror / code / Atom feed
0cd52e1a07727136b6922f0f96b207dba8df955e blob 820 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
#include <stdint.h>

#define MTE_TAG_GRANULE		16
#define MTE_TAG_MASK		(0xFULL << 56)

/**
 * Read the allocated tag for `addr`.
 */
static inline uintptr_t mte_load_tag(uintptr_t addr)
{
	uintptr_t tag;

	__asm__ __volatile__ ("ldg	%0, [%1]\n"
			      : "=&r" (tag) : "r"(addr));

	return tag;
}

/**
 * Store the allocated tag for `addr`.
 * The tag is derived from `addr`.
 */
static inline void mte_store_tag(uintptr_t addr)
{
	__asm__ __volatile__ ("stg	%0, [%0]\n"
			      : : "r"(addr) : "memory");
}

/**
 * Tag `addr` with random tag.
 * If the address is already tagged, make sure the new tag differs.
 */
static inline uintptr_t mte_insert_random_tag(uintptr_t addr)
{
	uintptr_t reg;

	__asm__ __volatile__("gmi	%0, %1, xzr\n"
			     "irg	%1, %1, %0\n"
			     : "=&r"(reg), "+r" (addr));
	return addr;
}
debug log:

solving 0cd52e1a ...
found 0cd52e1a in https://inbox.vuxu.org/musl/20240626084359.3241921-1-stefanjumarea02@gmail.com/

applying [1/1] https://inbox.vuxu.org/musl/20240626084359.3241921-1-stefanjumarea02@gmail.com/
diff --git a/arch/aarch64/mte.h b/arch/aarch64/mte.h
new file mode 100644
index 00000000..0cd52e1a

Checking patch arch/aarch64/mte.h...
Applied patch arch/aarch64/mte.h cleanly.

index at:
100644 0cd52e1a07727136b6922f0f96b207dba8df955e	arch/aarch64/mte.h

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).