00001 /* 00002 ** partvar.h for in /root/research/lseosr2/programs/part 00003 ** 00004 ** Made Copyright (c)2004 Julien Quintard 00005 ** Login <quinta_j@epita.fr> 00006 ** 00007 ** Started on Tue Mar 2 13:09:52 2004 Julien Quintard 00008 ** Last update Mon Nov 15 15:36:23 2004 Vianney Rancurel 00009 */ 00010 #ifndef PARTVAR_H 00011 #define PARTVAR_H 1 00012 #include <libc.h> 00013 #include <libide.h> 00014 00015 #define PART_DEBUG 00016 00017 #define PART_MBR_SIZE ATA_BLOCK_SIZE 00018 00019 #define PART_N 0x04 00020 #define PART_EXT 0x05 00021 #define PART_WIN_EXT 0x0f 00022 #define PART_LINUX_EXT 0x85 00023 #define PART_EXT_UNIT PART_N + 0x01 00024 #define PART_NOT_EXTENDED 0x00 00025 #define PART_EXTENDED 0x01 00026 #define PART_IN_EXTENDED 0x02 00027 00028 #define PARTS_PER_DEVICE 0x40 00029 #define PARTS_N (PARTS_PER_DEVICE * 0x4) 00030 00031 #define PART_PDEV 0x5 00032 00033 /* 00034 * part syscalls 00035 */ 00036 00037 #define SYSPART_GETACTIVE 0x1 00038 #define SYSPART_GET 0x2 00039 #define SYSPART_SET 0x3 /* to remove in release version */ 00040 00041 typedef struct s_mbr_entry 00042 { 00043 u_int8_t me_active; 00044 u_int8_t me_start_head; 00045 u_int8_t me_start_sector; 00046 u_int8_t me_start_cylinder; 00047 u_int8_t me_type; 00048 u_int8_t me_end_head; 00049 u_int8_t me_end_sector; 00050 u_int8_t me_end_cylinder; 00051 u_int32_t me_lba; 00052 u_int32_t me_size; 00053 } t_mbr_entry; 00054 00055 typedef struct s_part 00056 { 00057 u_int32_t p_pdev; 00058 00059 u_int32_t p_dev; /* device no */ 00060 char p_id; 00061 00062 u_int32_t p_unit; 00063 00064 u_int8_t p_active; 00065 u_int8_t p_type; 00066 u_int8_t p_extended; 00067 u_int32_t p_start; 00068 u_int32_t p_size; 00069 } t_part; 00070 00071 typedef struct s_part_type 00072 { 00073 u_int8_t pt_type; 00074 char *pt_name; 00075 } t_part_type; 00076 00077 typedef struct s_part_info 00078 { 00079 t_part pi_parts[PARTS_N]; 00080 u_int32_t pi_slot; 00081 00082 char mbr_sector[PART_MBR_SIZE]; 00083 00084 __cpu_simple_lock_t pi_lock; 00085 pid_t pi_sys_pid; 00086 00087 u_int32_t pi_npdev; 00088 } t_part_info; 00089 00090 00091 /* PROTO main.c */ 00092 #ifdef KERNEL 00093 /* main.c */ 00094 #endif /* KERNEL */ 00095 #endif