|
Revision 3dededd20d70d571268417dc41edc95f0fe6602e, 511 bytes
(checked in by H. Peter Anvin <hpa@…>, 2 years ago)
|
|
memdump: allow outputting S-records
Allow outputting S-records, for users who only have the capability of
passively monitoring a serial port as opposed to being able to capture
the contents directly.
Signed-off-by: H. Peter Anvin <hpa@…>
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | #ifndef FILE_H |
|---|
| 2 | #define FILE_H |
|---|
| 3 | |
|---|
| 4 | #include "mystuff.h" |
|---|
| 5 | |
|---|
| 6 | struct serial_if { |
|---|
| 7 | int port; |
|---|
| 8 | void *pvt; |
|---|
| 9 | void (*read) (struct serial_if *, void *, size_t); |
|---|
| 10 | void (*write) (struct serial_if *, const void *, size_t); |
|---|
| 11 | }; |
|---|
| 12 | |
|---|
| 13 | struct file_info { |
|---|
| 14 | const char *name; |
|---|
| 15 | size_t base; |
|---|
| 16 | size_t size; |
|---|
| 17 | void *pvt; |
|---|
| 18 | }; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | int serial_init(struct serial_if *sif); |
|---|
| 22 | void serial_read(struct serial_if *sif, void *data, size_t n); |
|---|
| 23 | void serial_write(struct serial_if *sif, const void *data, size_t n); |
|---|
| 24 | |
|---|
| 25 | #endif /* FILE_H */ |
|---|