view leo-obj/tool/intstruct.h @ 371:c7514c8b5b41

pirelli/headset: plug insertion detection figured out
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 14 Jun 2021 01:33:48 +0000
parents 71e25510f5af
children
line wrap: on
line source

/*
 * The structures defined in this header file
 * are internal to our utility.
 */

struct internal_scnhdr {
	char		*name;
	unsigned	size;
	unsigned	data_offset;
	unsigned	reloc_offset;
	unsigned	line_offset;
	unsigned	nreloc;
	unsigned	nlineent;
	unsigned	flags;
	unsigned	nsymbols;
	struct internal_syment **sorted_symbols;
	struct internal_reloc *int_relocs;
	int		disasm_mode;
	struct hint	*hints;
};

#define	DISASM_MODE_UNKNOWN	0
#define	DISASM_MODE_CODE	1
#define	DISASM_MODE_DATA	2
#define	DISASM_MODE_BSS		3

struct internal_syment {
	unsigned	number;
	char		*name;
	unsigned	value;
	int		scnum;
	int		type;
	int		class;
	u_char		*aux;
	struct internal_scnhdr *section;
	char		*struct_name;
	char		*struct_name_raw;
};

struct internal_reloc {
	unsigned	location;
	struct internal_syment *sym;
	int		type;
	char		*typestr;
};

struct internal_lineno {
	unsigned	location;
	unsigned	lineno;
};

struct hint {
	unsigned	pos;
	unsigned	endpos;
	int		type;
	int		linebrk;
	struct hint	*next;
};

#define	HINT_D8		1
#define	HINT_D16	2
#define	HINT_ASCIZ	3
#define	HINT_D32	4