Skip to content
Snippets Groups Projects
Select Git revision
  • f4956f620d065d8fa4d7a890cad548549e0b91ea
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

emulate.c

Blame
  • page-types.c 30.42 KiB
    /*
     * page-types: Tool for querying page flags
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the Free
     * Software Foundation; version 2.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
     * more details.
     *
     * You should find a copy of v2 of the GNU General Public License somewhere on
     * your Linux system; if not, write to the Free Software Foundation, Inc., 59
     * Temple Place, Suite 330, Boston, MA 02111-1307 USA.
     *
     * Copyright (C) 2009 Intel corporation
     *
     * Authors: Wu Fengguang <fengguang.wu@intel.com>
     */
    
    #define _FILE_OFFSET_BITS 64
    #define _GNU_SOURCE
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <stdint.h>
    #include <stdarg.h>
    #include <string.h>
    #include <getopt.h>
    #include <limits.h>
    #include <assert.h>
    #include <ftw.h>
    #include <time.h>
    #include <setjmp.h>
    #include <signal.h>
    #include <sys/types.h>
    #include <sys/errno.h>
    #include <sys/fcntl.h>
    #include <sys/mount.h>
    #include <sys/statfs.h>
    #include <sys/mman.h>
    #include "../../include/uapi/linux/magic.h"
    #include "../../include/uapi/linux/kernel-page-flags.h"
    #include <api/fs/fs.h>
    
    #ifndef MAX_PATH
    # define MAX_PATH 256
    #endif
    
    #ifndef STR
    # define _STR(x) #x
    # define STR(x) _STR(x)
    #endif
    
    /*
     * pagemap kernel ABI bits
     */
    
    #define PM_ENTRY_BYTES		8
    #define PM_PFRAME_BITS		55
    #define PM_PFRAME_MASK		((1LL << PM_PFRAME_BITS) - 1)
    #define PM_PFRAME(x)		((x) & PM_PFRAME_MASK)
    #define MAX_SWAPFILES_SHIFT	5
    #define PM_SWAP_OFFSET(x)	(((x) & PM_PFRAME_MASK) >> MAX_SWAPFILES_SHIFT)
    #define PM_SOFT_DIRTY		(1ULL << 55)
    #define PM_MMAP_EXCLUSIVE	(1ULL << 56)
    #define PM_FILE			(1ULL << 61)
    #define PM_SWAP			(1ULL << 62)
    #define PM_PRESENT		(1ULL << 63)