-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.h
88 lines (72 loc) · 2.31 KB
/
options.h
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
/*
This file is part of AVRtest -- A simple simulator for the
AVR family of 8-bit microcontrollers designed to test the compiler.
Copyright (C) 2001, 2002, 2003 Theodore A. Roth, Klaus Rudolph
Copyright (C) 2007 Paulo Marques
Copyright (C) 2008-2024 Free Software Foundation, Inc.
AVRtest 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 2 of the License, or
(at your option) any later version.
AVRtest 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 AVRtest; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef OPTIONS_H
#define OPTIONS_H
#include <stdbool.h>
typedef struct
{
// Name of the architecture from -mmcu=
const char *name;
// True if PC is 3 bytes, false if only 2 bytes
bool pc_3bytes;
// True if the architecture has EIND related insns (EICALL/EIJMP)
bool has_eind;
// True if this is XMEGA
bool is_xmega;
// True if the architecture has the RAMPD special function register.
bool has_rampd;
// True if this is reduced TINY
bool is_tiny;
// Mask to detect whether cpu_PC is out of bounds
unsigned int flash_addr_mask;
// Offset where flash is seen in RAM address space, or 0.
unsigned int flash_pm_offset;
} arch_t;
extern arch_t arch;
enum
{
#define AVRTEST_OPT(NAME, DEFLT, VAR) \
OPT_ ## VAR,
#include "options.def"
#undef AVRTEST_OPT
OPT_unknown
};
typedef struct
{
// program name of avrtest
const char *self;
#define AVRTEST_OPT(NAME, DEFLT, VAR) \
int do_ ## VAR; \
const char *s_ ## VAR;
#include "options.def"
#undef AVRTEST_OPT
} options_t;
typedef struct
{
int argc, i;
char **argv;
int avr_argc, avr_argv;
} args_t;
extern void parse_args (int argc, char *argv[]);
extern char** comma_list_to_array (const char *tokens, int *n);
extern options_t options;
extern args_t args;
extern arch_t arch;
extern const char *fileio_sandbox;
#endif // OPTIONS_H