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

#ifndef _HV_HVGDK_EXT_H
#define _HV_HVGDK_EXT_H

#include "hvgdk_mini.h"


#define HV_EXT_CALL_QUERY_CAPABILITIES		0x8001
#define HV_EXT_CALL_MEMORY_HEAT_HINT		0x8003


enum {		
	HV_EXTCALL_QUERY_CAPABILITIES = 0x8001,
	HV_EXTCALL_MEMORY_HEAT_HINT   = 0x8003,
};


#define HV_EXT_CAPABILITY_MEMORY_COLD_DISCARD_HINT BIT(8)

enum {		
	HV_EXTMEM_HEAT_HINT_COLD = 0,
	HV_EXTMEM_HEAT_HINT_HOT = 1,
	HV_EXTMEM_HEAT_HINT_COLD_DISCARD = 2,
	HV_EXTMEM_HEAT_HINT_MAX
};


#define HV_MEMORY_HINT_MAX_GPA_PAGE_RANGES  \
	((HV_HYP_PAGE_SIZE - sizeof(struct hv_memory_hint)) / \
		sizeof(union hv_gpa_page_range))


#define HV_EXT_MEMORY_HEAT_HINT_TYPE_COLD_DISCARD	2
struct hv_memory_hint {		
	u64 heat_type : 2;	
	u64 reserved : 62;
	union hv_gpa_page_range ranges[];
} __packed;

#endif 
