]>
Commit | Line | Data |
---|---|---|
66ee8158 | 1 | #include <linux/types.h> /* for __u16, __u32 */ |
2b6fc908 KZ |
2 | |
3 | typedef struct { | |
4 | unsigned char info[128]; /* Informative text string */ | |
5 | unsigned char spare0[14]; | |
6 | struct sun_info { | |
7 | unsigned char spare1; | |
8 | unsigned char id; | |
9 | unsigned char spare2; | |
10 | unsigned char flags; | |
11 | } infos[8]; | |
12 | unsigned char spare1[246]; /* Boot information etc. */ | |
13 | unsigned short rspeed; /* Disk rotational speed */ | |
14 | unsigned short pcylcount; /* Physical cylinder count */ | |
15 | unsigned short sparecyl; /* extra sects per cylinder */ | |
16 | unsigned char spare2[4]; /* More magic... */ | |
17 | unsigned short ilfact; /* Interleave factor */ | |
18 | unsigned short ncyl; /* Data cylinder count */ | |
19 | unsigned short nacyl; /* Alt. cylinder count */ | |
20 | unsigned short ntrks; /* Tracks per cylinder */ | |
21 | unsigned short nsect; /* Sectors per track */ | |
22 | unsigned char spare3[4]; /* Even more magic... */ | |
23 | struct sun_partition { | |
24 | __u32 start_cylinder; | |
25 | __u32 num_sectors; | |
26 | } partitions[8]; | |
27 | unsigned short magic; /* Magic number */ | |
28 | unsigned short csum; /* Label xor'd checksum */ | |
29 | } sun_partition; | |
30 | ||
31 | #define SUN_LABEL_MAGIC 0xDABE | |
32 | #define SUN_LABEL_MAGIC_SWAPPED 0xBEDA | |
22853e4a | 33 | #define sunlabel ((sun_partition *)MBRbuffer) |
2b6fc908 KZ |
34 | #define SSWAP16(x) (other_endian ? __swap16(x) \ |
35 | : (__u16)(x)) | |
36 | #define SSWAP32(x) (other_endian ? __swap32(x) \ | |
37 | : (__u32)(x)) | |
38 | ||
2b6fc908 | 39 | /* fdisk.c */ |
22853e4a | 40 | extern char MBRbuffer[MAX_SECTOR_SIZE]; |
2b6fc908 KZ |
41 | extern uint heads, sectors, cylinders; |
42 | extern int show_begin; | |
43 | extern int sun_label; | |
44 | extern char *partition_type(unsigned char type); | |
45 | extern void update_units(void); | |
46 | extern char read_chars(char *mesg); | |
22853e4a KZ |
47 | extern void set_all_unchanged(void); |
48 | extern void set_changed(int); | |
2b6fc908 KZ |
49 | |
50 | /* fdisksunlabel.c */ | |
51 | #define SUNOS_SWAP 3 | |
52 | #define WHOLE_DISK 5 | |
53 | ||
54 | extern struct systypes sun_sys_types[]; | |
55 | extern int get_num_sectors(struct sun_partition p); | |
56 | extern void guess_device_type(int fd); | |
57 | extern int check_sun_label(void); | |
5c36a0eb | 58 | extern void sun_nolabel(void); |
2b6fc908 KZ |
59 | extern void create_sunlabel(void); |
60 | extern void sun_delete_partition(int i); | |
61 | extern void sun_change_sysid(int i, int sys); | |
62 | extern void sun_list_table(int xtra); | |
63 | extern void verify_sun(void); | |
64 | extern void add_sun_partition(int n, int sys); | |
65 | extern void sun_write_table(void); | |
66 | extern void sun_set_alt_cyl(void); | |
67 | extern void sun_set_ncyl(int cyl); | |
68 | extern void sun_set_xcyl(void); | |
69 | extern void sun_set_ilfact(void); | |
70 | extern void sun_set_rspeed(void); | |
71 | extern void sun_set_pcylcount(void); | |
72 | extern void toggle_sunflags(int i, unsigned char mask); | |
73 |