-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmap.h
78 lines (60 loc) · 2.45 KB
/
map.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
/* map.c - Map file creation
*
* Copyright 1992-1998 Werner Almesberger
* Copyright 1999-2004 John Coffman
* Copyright 2009-2011 Joachim Wiedorn
* All rights reserved.
*
* Licensed under the terms contained in the file 'COPYING'
* in the source directory.
*/
#ifndef MAP_H
#define MAP_H
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
void map_patch_first(char *name,char *str);
/* Puts str into the first sector of a map file. */
void map_create(char *name);
/* Create and initialize the specified map file. */
void map_descrs(DESCR_SECTORS *descr, SECTOR_ADDR* addr, SECTOR_ADDR* dflcmd);
/* Updates map file with descriptors & default command line */
void map_close(BOOT_PARAMS_2 *param2, off_t here);
/* closes the map file, write second stage parameters */
void map_add_sector(void *sector);
/* Adds the specified sector to the map file and registers it in the map
section. */
void map_begin_section(void);
/* Begins a map section. Note: maps can also be written to memory with
map_write. Thus, the map routines can be used even without map_create. */
void map_add(GEOMETRY *geo,int from,int num_sect);
/* Adds pointers to sectors from the specified file to the map file, starting
"from" sectors from the beginning. */
void map_add_zero(void);
/* Adds a zero-filled sector to the current section. */
int map_end_section(SECTOR_ADDR *addr,int dont_compact);
/* Writes a map section to the map file and returns the address of the first
sector of that section. The first DONT_COMPACT sectors are never compacted.
Returns the number of sectors that have been mapped. */
#ifdef LCF_FIRST6
int map_write(SECTOR_ADDR *list,int max_len,int terminate,int sa6);
#else
int map_write(SECTOR_ADDR *list,int max_len,int terminate);
#endif
/* Writes a map section to an array. If terminate is non-zero, a terminating
zero entry is written. If the section (including the terminating zero entry)
exceeds max_len sectors, map_write dies. */
off_t map_insert_file(GEOMETRY *geo, int skip, int sectors);
/* Copies a file (second stage loader, usually) into the map file, skipping
'skip' sectors at the beginning, and writing 'sectors' sectors. The
sectors are added to the current map section. */
off_t map_insert_data(unsigned char *data, int size);
/* Copies data from an internal array into the map file. The sectors
are added to the current map section */
#endif