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

cmd-db.h (1097B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */
      3
      4#ifndef __QCOM_COMMAND_DB_H__
      5#define __QCOM_COMMAND_DB_H__
      6
      7#include <linux/err.h>
      8
      9enum cmd_db_hw_type {
     10	CMD_DB_HW_INVALID = 0,
     11	CMD_DB_HW_MIN     = 3,
     12	CMD_DB_HW_ARC     = CMD_DB_HW_MIN,
     13	CMD_DB_HW_VRM     = 4,
     14	CMD_DB_HW_BCM     = 5,
     15	CMD_DB_HW_MAX     = CMD_DB_HW_BCM,
     16	CMD_DB_HW_ALL     = 0xff,
     17};
     18
     19#if IS_ENABLED(CONFIG_QCOM_COMMAND_DB)
     20u32 cmd_db_read_addr(const char *resource_id);
     21
     22const void *cmd_db_read_aux_data(const char *resource_id, size_t *len);
     23
     24enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id);
     25
     26int cmd_db_ready(void);
     27#else
     28static inline u32 cmd_db_read_addr(const char *resource_id)
     29{ return 0; }
     30
     31static inline const void *cmd_db_read_aux_data(const char *resource_id, size_t *len)
     32{ return ERR_PTR(-ENODEV); }
     33
     34static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id)
     35{ return -ENODEV; }
     36
     37static inline int cmd_db_ready(void)
     38{ return -ENODEV; }
     39#endif /* CONFIG_QCOM_COMMAND_DB */
     40#endif /* __QCOM_COMMAND_DB_H__ */