Zerocat Chipflasher  v0.4.3 (board-edition-1)
Flash free firmware to BIOS chips, kick the Manageability Engine.
filespec.c
Go to the documentation of this file.
1 /******************************************************************/
27 #ifndef __FILESPEC_C__
28 #define __FILESPEC_C__
29 
30 struct tag_filespec filespec[2] = {
31  {
32  //to be calculated:
34  //fixed:
35  MOTBIN,
37  "Motorola-S"
38  },
39  {
40  //to be calculated:
42  //fixed:
43  HEXDUMP,
45  "Hex-Dump"
46  }
47 };
48 
49 
50 inline int payload(
51  enum tag_format format,
52  int chipsize
53  )
54 {
55  if(format != HEXDUMP) {
56  if(chipsize > (1 << 16)) //64K
57  return PAYLOAD_BASE << 2;
58  if(chipsize > (1 << 8)) //256
59  return PAYLOAD_BASE << 1;
60  }
61  return PAYLOAD_BASE;
62 }
63 
64 
65 
67  int chipsize
68  )
69 {
70  struct tag_filespec *p;
71  int n = ARRAY_FILESPEC;
72 
73  while(n--) {
74  p = &filespec[n];
75  p->payload_default = payload(p->format, chipsize);
76  }
77 }
78 
79 #endif
80 /* __FILESPEC_C__ */
tag_filespec::payload_default
unsigned char payload_default
Pure data bytes per line.
Definition: filespec.h:58
MODE_HEXDUMP
#define MODE_HEXDUMP
Definition: filespec.h:46
MODE_MOTBIN
#define MODE_MOTBIN
Definition: filespec.h:47
ARRAY_FILESPEC
#define ARRAY_FILESPEC
Definition: filespec.h:34
HEXDUMP
@ HEXDUMP
Definition: filespec.h:54
tag_filespec::format
enum tag_format format
Definition: filespec.h:59
MOTBIN
@ MOTBIN
Definition: filespec.h:53
filespec
struct tag_filespec filespec[2]
Definition: filespec.c:30
PAYLOAD_BASE
#define PAYLOAD_BASE
Definition: filespec.h:35
payload
int payload(enum tag_format format, int chipsize)
Definition: filespec.c:50
tag_filespec
Definition: filespec.h:57
tag_format
tag_format
Definition: filespec.h:52
filespec_ini
void filespec_ini(int chipsize)
Definition: filespec.c:66