Просмотр исходного кода

Add off_t and physaddr_t, and the copy_{to,from}_phys helper routines.

tags/v0.9.3
Michael Brown 20 лет назад
Родитель
Сommit
e3f2aa7b4d
2 измененных файлов: 11 добавлений и 0 удалений
  1. 3
    0
      src/arch/i386/include/stdint.h
  2. 8
    0
      src/arch/i386/include/virtaddr.h

+ 3
- 0
src/arch/i386/include/stdint.h Просмотреть файл

2
 #define STDINT_H
2
 #define STDINT_H
3
 
3
 
4
 typedef unsigned           size_t;
4
 typedef unsigned           size_t;
5
+typedef unsigned	   off_t;
5
 
6
 
6
 typedef unsigned char      uint8_t;
7
 typedef unsigned char      uint8_t;
7
 typedef unsigned short     uint16_t;
8
 typedef unsigned short     uint16_t;
13
 typedef signed long        int32_t;
14
 typedef signed long        int32_t;
14
 typedef signed long long   int64_t;
15
 typedef signed long long   int64_t;
15
 
16
 
17
+typedef unsigned long	   physaddr_t;
18
+
16
 #endif /* STDINT_H */
19
 #endif /* STDINT_H */

+ 8
- 0
src/arch/i386/include/virtaddr.h Просмотреть файл

45
 	return ( void * ) ( phys_addr - virt_offset );
45
 	return ( void * ) ( phys_addr - virt_offset );
46
 }
46
 }
47
 
47
 
48
+static inline void copy_to_phys ( physaddr_t dest, void *src, size_t len ) {
49
+	memcpy ( phys_to_virt ( dest ), src, len );
50
+}
51
+
52
+static inline void copy_from_phys ( void *dest, physaddr_t src, size_t len ) {
53
+	memcpy ( dest, phys_to_virt ( src ), len );
54
+}
55
+
48
 #else /* KEEP_IT_REAL */
56
 #else /* KEEP_IT_REAL */
49
 
57
 
50
 /*
58
 /*

Загрузка…
Отмена
Сохранить