/usr/include/simavr/sim_elf.h is in libsimavr-dev 1.5+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | /*
sim_elf.h
Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
This file is part of simavr.
simavr is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simavr is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simavr. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SIM_ELF_H__
#define __SIM_ELF_H__
#include "avr/avr_mcu_section.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ELF_SYMBOLS
#define ELF_SYMBOLS 1
#endif
/* these are the addresses the gnu linker uses to
* "fake" a non-Harvard addressing space for the AVR
*/
#define AVR_SEGMENT_OFFSET_FLASH 0
#define AVR_SEGMENT_OFFSET_EEPROM 0x00810000
#include "sim_avr.h"
typedef struct elf_firmware_t {
char mmcu[64];
uint32_t frequency;
uint32_t vcc,avcc,aref;
char tracename[128]; // trace filename
uint32_t traceperiod;
int tracecount;
struct {
uint8_t kind;
uint8_t mask;
uint16_t addr;
char name[64];
} trace[32];
struct {
char port;
uint8_t mask, value;
} external_state[8];
// register to listen to for commands from the firmware
uint16_t command_register_addr;
uint16_t console_register_addr;
uint32_t flashbase; // base address
uint8_t * flash;
uint32_t flashsize;
uint32_t datasize;
uint32_t bsssize;
// read the .eeprom section of the elf, too
uint8_t * eeprom;
uint32_t eesize;
uint8_t * fuse;
uint32_t fusesize;
uint8_t * lockbits;
#if ELF_SYMBOLS
avr_symbol_t ** symbol;
uint32_t symbolcount;
#endif
} elf_firmware_t ;
int elf_read_firmware(const char * file, elf_firmware_t * firmware);
void avr_load_firmware(avr_t * avr, elf_firmware_t * firmware);
#ifdef __cplusplus
};
#endif
#endif /*__SIM_ELF_H__*/
|