-
Notifications
You must be signed in to change notification settings - Fork 25
/
rwcode2.h
69 lines (61 loc) · 1.21 KB
/
rwcode2.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
#ifndef BCM2_DUMP_RWCODE2_H
#define BCM2_DUMP_RWCODE2_H
#include "profile.h"
#ifdef __cplusplus
extern "C" {
#endif
// Environment for uploading and executing code
// on another machine. Memory layout:
//
// 0x0000 entry code
// 0x0100 entry data
//
// entry data:
// u32 flags
// u32 retval
// u32 function
// u32 argc
// u32[] argv
//
// entry code does:
// * locate itself in RAM
// * load private data
// * if function call, do so now
struct bcm2_read_args
{
char str_x[4];
char str_nl[4];
uint32_t flags;
uint32_t buffer;
uint32_t offset;
uint32_t length;
uint32_t chunklen;
uint32_t index;
uint32_t printf;
uint32_t fl_read;
struct bcm2_patch patches[BCM2_PATCH_NUM];
} __attribute__((aligned(4)));
void mips_read();
struct bcm2_write_args
{
char str_2x[8];
char str_nl[4];
uint32_t flags;
uint32_t buffer;
uint32_t offset;
uint32_t length;
uint32_t chunklen;
uint32_t index;
uint32_t printf;
uint32_t xscanf;
uint32_t getline;
uint32_t fl_erase;
uint32_t fl_write;
struct bcm2_patch erase_patches[BCM2_PATCH_NUM];
struct bcm2_patch write_patches[BCM2_PATCH_NUM];
} __attribute__((aligned(4)));
void mips_write();
#ifdef __cplusplus
}
#endif
#endif