clist: make debugging better
parent
c620f2ae34
commit
825a981d67
@ -0,0 +1,9 @@
|
||||
/* Copyright (C) 2021 fef <owo@fef.moe>. All rights reserved. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define POISON_BASE 0xdead000000000000ul
|
||||
#else
|
||||
#define POISON_BASE 0x00000000ul
|
||||
#endif
|
@ -0,0 +1,30 @@
|
||||
/* Copyright (C) 2021 fef <owo@fef.moe>. All rights reserved. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <arch/poison.h>
|
||||
|
||||
/*
|
||||
* If possible, arch should define this value as an unmappable base address.
|
||||
* For example, on the amd64, this is set to 0xdead000000000000 because the
|
||||
* highest 17 bits of linear addresses must always be identical there.
|
||||
* As a result, it will *always* page fault when dereferenced, no matter
|
||||
* the current state of the page maps.
|
||||
*/
|
||||
#ifndef POISON_BASE
|
||||
#define POISON_BASE 0ul
|
||||
#endif
|
||||
|
||||
/*
|
||||
* You should only use values that `sus_nil()` finds sus (i.e. values < 0x1000),
|
||||
* and whose LSB is zero. The latter is a little safety measure because most
|
||||
* architectures use bit 0 of the page maps as a present flag. So, even if the
|
||||
* impossible happens and this *somehow* ends up in a page map, it is marked as
|
||||
* non-present and therefore page faults rather than exposing anything.
|
||||
*/
|
||||
|
||||
#define PAGE_POISON_ALLOC (POISON_BASE + 0x00000010ul)
|
||||
#define PAGE_POISON_FREE (POISON_BASE + 0x00000020ul)
|
||||
|
||||
#define CLIST_POISON_PREV (POISON_BASE + 0x000000c4ul)
|
||||
#define CLIST_POISON_NEXT (POISON_BASE + 0x000000c8ul)
|
Loading…
Reference in New Issue