kernel_samsung_a34x-permissive/drivers/misc/mediatek/aee/mrdump/mrdump_arm.c
2024-04-28 15:49:01 +02:00

25 lines
657 B
C
Executable file

// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2016 MediaTek Inc.
*/
#include <linux/bug.h>
#include <linux/compiler.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/ptrace.h>
#include <mt-plat/mrdump.h>
#include "mrdump_private.h"
void mrdump_save_control_register(void *creg)
{
struct arm32_ctrl_regs *cregs = (struct arm32_ctrl_regs *)creg;
asm volatile ("mrc p15, 0, %0, c1, c0, 0\n\t"
"mrc p15, 0, %1, c2, c0, 2\n\t"
"mrc p15, 0, %2, c2, c0, 0\n\t"
"mrc p15, 0, %3, c2, c0, 1\n\t"
: "=r"(cregs->sctlr), "=r"(cregs->ttbcr),
"=r"(cregs->ttbr0), "=r"(cregs->ttbr1) : : "memory");
}