Blame src/internal/mdso_driver_impl.h

cde03b
#ifndef MDSO_DRIVER_IMPL_H
cde03b
#define MDSO_DRIVER_IMPL_H
cde03b
cde03b
#include <stdint.h>
cde03b
#include <stdio.h>
cde03b
#include <sys/types.h>
cde03b
cde03b
#include <mdso/mdso.h>
a5071f
#include "argv/argv.h"
a5071f
a5071f
extern const struct argv_option mdso_default_options[];
cde03b
cde03b
enum app_tags {
cde03b
	TAG_HELP,
cde03b
	TAG_VERSION,
7c0ec4
	TAG_QUAD_PTR,
6848b7
	TAG_LIBPATH,
d8c2b3
	TAG_LIBNAME,
d8c2b3
	TAG_DSTDIR,
8cfad6
	TAG_PRETTY,
8cfad6
	TAG_EXPSYMS,
cde03b
};
cde03b
43f283
struct mdso_expsyms {
43f283
	char *		buffer;
43f283
	const char *	syms[];
43f283
};
43f283
cde03b
struct mdso_driver_ctx_impl {
cde03b
	struct mdso_common_ctx	cctx;
cde03b
	struct mdso_driver_ctx	ctx;
938a47
	char *			asmbase;
938a47
	int			fddst;
db4864
	int			fdtmpin;
a9007d
	struct mdso_error_info**errinfp;
a9007d
	struct mdso_error_info**erricap;
a9007d
	struct mdso_error_info *erriptr[64];
a9007d
	struct mdso_error_info	erribuf[64];
cde03b
};
cde03b
cde03b
struct mdso_unit_ctx_impl {
cde03b
	const char *		path;
cde03b
	struct mdso_input	map;
43f283
	struct mdso_expsyms *	expsyms;
cde03b
	struct mdso_common_ctx	cctx;
cde03b
	struct mdso_unit_ctx	uctx;
cde03b
};
cde03b
3a9f95
static inline struct mdso_driver_ctx_impl * mdso_get_driver_ictx(
3a9f95
	const struct mdso_driver_ctx * dctx)
3a9f95
{
3a9f95
        uintptr_t addr;
3a9f95
3a9f95
        if (dctx) {
3a9f95
                addr = (uintptr_t)dctx - offsetof(struct mdso_driver_ctx_impl,ctx);
3a9f95
                return (struct mdso_driver_ctx_impl *)addr;
3a9f95
        }
3a9f95
3a9f95
        return 0;
3a9f95
}
3a9f95
cde03b
#endif