cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

common.h (774B)


      1/* SPDX-License-Identifier: GPL-2.0-or-later */
      2#ifndef _MEMBLOCK_TEST_H
      3#define _MEMBLOCK_TEST_H
      4
      5#include <stdlib.h>
      6#include <assert.h>
      7#include <linux/types.h>
      8#include <linux/memblock.h>
      9#include <linux/sizes.h>
     10
     11#define MEM_SIZE SZ_16K
     12
     13/*
     14 * Available memory registered with memblock needs to be valid for allocs
     15 * test to run. This is a convenience wrapper for memory allocated in
     16 * dummy_physical_memory_init() that is later registered with memblock
     17 * in setup_memblock().
     18 */
     19struct test_memory {
     20	void *base;
     21};
     22
     23struct region {
     24	phys_addr_t base;
     25	phys_addr_t size;
     26};
     27
     28void reset_memblock_regions(void);
     29void reset_memblock_attributes(void);
     30void setup_memblock(void);
     31void dummy_physical_memory_init(void);
     32void dummy_physical_memory_cleanup(void);
     33
     34#endif