/* SPDX-License-Identifier: GPL-2.0 */


#ifndef __LINUX_RESCTRL_TYPES_H
#define __LINUX_RESCTRL_TYPES_H

#define MAX_MBA_BW			100u
#define MBM_OVERFLOW_INTERVAL		1000


#define READS_TO_LOCAL_MEM		BIT(0)


#define READS_TO_REMOTE_MEM		BIT(1)


#define NON_TEMP_WRITE_TO_LOCAL_MEM	BIT(2)


#define NON_TEMP_WRITE_TO_REMOTE_MEM	BIT(3)


#define READS_TO_LOCAL_S_MEM		BIT(4)


#define READS_TO_REMOTE_S_MEM		BIT(5)


#define DIRTY_VICTIMS_TO_ALL_MEM	BIT(6)


#define MAX_EVT_CONFIG_BITS		GENMASK(6, 0)


#define NUM_MBM_TRANSACTIONS		7


enum resctrl_event_id {
	
	QOS_FIRST_EVENT			= 0x01,

	
	QOS_L3_OCCUP_EVENT_ID		= 0x01,
	QOS_L3_MBM_TOTAL_EVENT_ID	= 0x02,
	QOS_L3_MBM_LOCAL_EVENT_ID	= 0x03,

	
	PMT_EVENT_ENERGY,
	PMT_EVENT_ACTIVITY,
	PMT_EVENT_STALLS_LLC_HIT,
	PMT_EVENT_C1_RES,
	PMT_EVENT_UNHALTED_CORE_CYCLES,
	PMT_EVENT_STALLS_LLC_MISS,
	PMT_EVENT_AUTO_C6_RES,
	PMT_EVENT_UNHALTED_REF_CYCLES,
	PMT_EVENT_UOPS_RETIRED,

	
	QOS_NUM_EVENTS,
};

#define QOS_NUM_L3_MBM_EVENTS	(QOS_L3_MBM_LOCAL_EVENT_ID - QOS_L3_MBM_TOTAL_EVENT_ID + 1)
#define MBM_STATE_IDX(evt)	((evt) - QOS_L3_MBM_TOTAL_EVENT_ID)

#endif 
