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

asm-offsets.c (1492B)


      1// SPDX-License-Identifier: GPL-2.0
      2/*
      3 * Generate definitions needed by assembly language modules.
      4 * This code generates raw asm output which is post-processed to extract
      5 * and format the required data.
      6 */
      7
      8#include <linux/types.h>
      9#include <linux/stddef.h>
     10#include <linux/sched.h>
     11#include <linux/ptrace.h>
     12#include <linux/kbuild.h>
     13#include <asm/io.h>
     14
     15void foo(void)
     16{
     17	DEFINE(TI_TASK, offsetof(struct thread_info, task));
     18	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
     19	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
     20	BLANK();
     21
     22        DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
     23        DEFINE(TASK_CRED, offsetof(struct task_struct, cred));
     24        DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
     25        DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
     26        DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
     27        BLANK();
     28
     29        DEFINE(CRED_UID,  offsetof(struct cred, uid));
     30        DEFINE(CRED_EUID, offsetof(struct cred, euid));
     31        DEFINE(CRED_GID,  offsetof(struct cred, gid));
     32        DEFINE(CRED_EGID, offsetof(struct cred, egid));
     33        BLANK();
     34
     35	DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
     36	DEFINE(PT_PTRACED, PT_PTRACED);
     37	DEFINE(CLONE_VM, CLONE_VM);
     38	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
     39	DEFINE(SIGCHLD, SIGCHLD);
     40	BLANK();
     41
     42	DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
     43	DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
     44}