read_kpageflags.h 1 KB
Newer Older
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
#include <stdint.h>
#include <unistd.h>

struct kpageflags_t {
    union {
        uint64_t data;
        struct {
            uint64_t __unused : 41;

            unsigned thp : 1;
            unsigned ksm : 1;
            unsigned nopage : 1;
            unsigned hwpoison : 1;
            unsigned unevictable : 1;
            unsigned huge : 1;
            unsigned compound_tail : 1;
            unsigned compound_head : 1;
            unsigned swapbacked : 1;
            unsigned swapcache : 1;
            unsigned anon : 1;
            unsigned mmap : 1;
            unsigned buddy : 1;
            unsigned reclaim : 1;
            unsigned writeback : 1;
            unsigned slab : 1;
            unsigned active : 1;
            unsigned lru : 1;
            unsigned dirty : 1;
            unsigned uptodate : 1;
            unsigned referenced : 1;
            unsigned error : 1;
            unsigned locked : 1;
        } flags;
    };
};

int read_kpageflags(int fd, uint64_t pfn, kpageflags_t* kpageflags);