linux/drivers/remoteproc/remoteproc_elf_helpers.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Remote processor elf helpers defines
 *
 * Copyright (C) 2020 Kalray, Inc.
 */

#ifndef REMOTEPROC_ELF_LOADER_H
#define REMOTEPROC_ELF_LOADER_H

#include <linux/elf.h>
#include <linux/types.h>

/**
 * fw_elf_get_class - Get elf class
 * @fw: the ELF firmware image
 *
 * Note that we use elf32_hdr to access the class since the start of the
 * struct is the same for both elf class
 *
 * Return: elf class of the firmware
 */
static inline u8 fw_elf_get_class(const struct firmware *fw)
{}

static inline void elf_hdr_init_ident(struct elf32_hdr *hdr, u8 class)
{}

/* Generate getter and setter for a specific elf struct/field */
#define ELF_GEN_FIELD_GET_SET(__s, __field, __type)

ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()

ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()

ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()
ELF_GEN_FIELD_GET_SET()

#define ELF_STRUCT_SIZE(__s)

ELF_STRUCT_SIZE()
ELF_STRUCT_SIZE()
ELF_STRUCT_SIZE()

static inline unsigned int elf_strtbl_add(const char *name, void *ehdr, u8 class, size_t *index)
{}

#endif /* REMOTEPROC_ELF_LOADER_H */