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





#ifndef _LINUX_KHO_ABI_LUO_H
#define _LINUX_KHO_ABI_LUO_H

#include <uapi/linux/liveupdate.h>


#define LUO_FDT_SIZE		PAGE_SIZE
#define LUO_FDT_KHO_ENTRY_NAME	"LUO"
#define LUO_FDT_COMPATIBLE	"luo-v1"
#define LUO_FDT_LIVEUPDATE_NUM	"liveupdate-number"

#define LIVEUPDATE_HNDL_COMPAT_LENGTH	48


struct luo_file_ser {
	char compatible[LIVEUPDATE_HNDL_COMPAT_LENGTH];
	u64 data;
	u64 token;
} __packed;


struct luo_file_set_ser {
	u64 files;
	u64 count;
} __packed;


#define LUO_FDT_SESSION_NODE_NAME	"luo-session"
#define LUO_FDT_SESSION_COMPATIBLE	"luo-session-v2"
#define LUO_FDT_SESSION_HEADER		"luo-session-header"


struct luo_session_header_ser {
	u64 count;
} __packed;


struct luo_session_ser {
	char name[LIVEUPDATE_SESSION_NAME_LENGTH];
	struct luo_file_set_ser file_set_ser;
} __packed;


#define LIVEUPDATE_FLB_COMPAT_LENGTH	48

#define LUO_FDT_FLB_NODE_NAME	"luo-flb"
#define LUO_FDT_FLB_COMPATIBLE	"luo-flb-v1"
#define LUO_FDT_FLB_HEADER	"luo-flb-header"


struct luo_flb_header_ser {
	u64 pgcnt;
	u64 count;
} __packed;


struct luo_flb_ser {
	char name[LIVEUPDATE_FLB_COMPAT_LENGTH];
	u64 data;
	u64 count;
} __packed;


#ifdef CONFIG_LIVEUPDATE_TEST
#define LIVEUPDATE_TEST_FLB_COMPATIBLE(i)	"liveupdate-test-flb-v" #i
#endif

#endif 
