Browse Source

Remove some obsolete sections of librm.h and libkir.h.

Add some of the missing parts to libkir.h.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
75912b3b77
2 changed files with 25 additions and 39 deletions
  1. 25
    25
      src/arch/i386/include/libkir.h
  2. 0
    14
      src/arch/i386/include/librm.h

+ 25
- 25
src/arch/i386/include/libkir.h View File

13
 /* Access to variables in .data16 and .text16 in a way compatible with librm */
13
 /* Access to variables in .data16 and .text16 in a way compatible with librm */
14
 #define __data16( variable ) variable
14
 #define __data16( variable ) variable
15
 #define __data16_array( variable, array ) variable array
15
 #define __data16_array( variable, array ) variable array
16
+#define __bss16( variable ) variable
17
+#define __bss16_array( variable, array ) variable array
16
 #define __text16( variable ) variable
18
 #define __text16( variable ) variable
17
 #define __text16_array( variable,array ) variable array
19
 #define __text16_array( variable,array ) variable array
18
 #define __use_data16( variable ) variable
20
 #define __use_data16( variable ) variable
38
 
40
 
39
 /* Copy to/from base memory */
41
 /* Copy to/from base memory */
40
 
42
 
41
-static inline void copy_to_real_libkir ( uint16_t dest_seg, uint16_t dest_off,
43
+static inline void copy_to_real_libkir ( unsigned int dest_seg,
44
+					 unsigned int dest_off,
42
 					 const void *src, size_t n ) {
45
 					 const void *src, size_t n ) {
43
-	__asm__ __volatile__ ( "movw %4, %%es\n\t"
44
-			       "cld\n\t"
46
+	unsigned int discard_D, discard_S, discard_c;
47
+
48
+	__asm__ __volatile__ ( "pushw %%es\n\t"
49
+			       "movw %3, %%es\n\t"
45
 			       "rep movsb\n\t"
50
 			       "rep movsb\n\t"
46
-			       "pushw %%ds\n\t" /* restore %es */
47
 			       "popw %%es\n\t"
51
 			       "popw %%es\n\t"
48
-			       : "=S" ( src ), "=D" ( dest_off ),
49
-			         "=c" ( n ) /* clobbered */
50
-			       : "S" ( src ), "r" ( dest_seg ),
51
-			         "D" ( dest_off ), "c" ( n )
52
+			       : "=D" ( discard_D ), "=S" ( discard_S ),
53
+			         "=c" ( discard_c )
54
+			       : "r" ( dest_seg ), "D" ( dest_off ),
55
+			         "S" ( src ),
56
+			         "c" ( n )
52
 			       : "memory" );
57
 			       : "memory" );
53
 }
58
 }
54
 
59
 
55
 static inline void copy_from_real_libkir ( void *dest,
60
 static inline void copy_from_real_libkir ( void *dest,
56
-					   uint16_t src_seg, uint16_t src_off,
61
+					   unsigned int src_seg,
62
+					   unsigned int src_off,
57
 					   size_t n ) {
63
 					   size_t n ) {
58
-	__asm__ __volatile__ ( "movw %%ax, %%ds\n\t"
59
-			       "cld\n\t"
64
+	unsigned int discard_D, discard_S, discard_c;
65
+
66
+	__asm__ __volatile__ ( "pushw %%ds\n\t"
67
+			       "movw %4, %%ds\n\t"
60
 			       "rep movsb\n\t"
68
 			       "rep movsb\n\t"
61
-			       "pushw %%es\n\t" /* restore %ds */
62
 			       "popw %%ds\n\t"
69
 			       "popw %%ds\n\t"
63
-			       : "=S" ( src_off ), "=D" ( dest ),
64
-			         "=c" ( n ) /* clobbered */
65
-			       : "a" ( src_seg ), "S" ( src_off ),
66
-			         "D" ( dest ), "c" ( n )
70
+			       : "=D" ( discard_D ), "=S" ( discard_S ),
71
+			         "=c" ( discard_c )
72
+			       : "D" ( dest ),
73
+			         "r" ( src_seg ), "S" ( src_off ),
74
+			         "c" ( n )
67
 			       : "memory" );
75
 			       : "memory" );
68
 }
76
 }
77
+
69
 #define copy_to_real copy_to_real_libkir
78
 #define copy_to_real copy_to_real_libkir
70
 #define copy_from_real copy_from_real_libkir
79
 #define copy_from_real copy_from_real_libkir
71
 
80
 
204
 	return real_to_user ( rm_ds, ( intptr_t ) virtual );
213
 	return real_to_user ( rm_ds, ( intptr_t ) virtual );
205
 }
214
 }
206
 
215
 
207
-/* Place/remove parameter on real-mode stack in a way that's
208
- * compatible with libkir
209
- */
210
-#define BASEMEM_PARAMETER_INIT_LIBKIR( param ) \
211
-	( ( uint16_t ) ( ( uint32_t ) & ( param ) ) )
212
-#define BASEMEM_PARAMETER_DONE_LIBKIR( param )
213
-#define BASEMEM_PARAMETER_INIT BASEMEM_PARAMETER_INIT_LIBKIR
214
-#define BASEMEM_PARAMETER_DONE BASEMEM_PARAMETER_DONE_LIBKIR
215
-
216
 /* TEXT16_CODE: declare a fragment of code that resides in .text16 */
216
 /* TEXT16_CODE: declare a fragment of code that resides in .text16 */
217
 #define TEXT16_CODE( asm_code_str )			\
217
 #define TEXT16_CODE( asm_code_str )			\
218
 	".section \".text16\", \"ax\", @progbits\n\t"	\
218
 	".section \".text16\", \"ax\", @progbits\n\t"	\

+ 0
- 14
src/arch/i386/include/librm.h View File

263
 	return virt_to_phys ( ( void * ) buffer + offset );
263
 	return virt_to_phys ( ( void * ) buffer + offset );
264
 }
264
 }
265
 
265
 
266
-/* Copy to/from real-mode stack */
267
-extern uint16_t copy_to_rm_stack ( void *data, size_t size );
268
-extern void remove_from_rm_stack ( void *data, size_t size );
269
-
270
-/* Place/remove parameter on real-mode stack in a way that's
271
- * compatible with libkir
272
- */
273
-#define BASEMEM_PARAMETER_INIT_LIBRM( param ) \
274
-	copy_to_rm_stack ( & ( param ), sizeof ( param ) )
275
-#define BASEMEM_PARAMETER_DONE_LIBRM( param ) \
276
-	remove_from_rm_stack ( & ( param ), sizeof ( param ) )
277
-#define BASEMEM_PARAMETER_INIT BASEMEM_PARAMETER_INIT_LIBRM
278
-#define BASEMEM_PARAMETER_DONE BASEMEM_PARAMETER_DONE_LIBRM
279
-
280
 /* TEXT16_CODE: declare a fragment of code that resides in .text16 */
266
 /* TEXT16_CODE: declare a fragment of code that resides in .text16 */
281
 #define TEXT16_CODE( asm_code_str )			\
267
 #define TEXT16_CODE( asm_code_str )			\
282
 	".section \".text16\", \"ax\", @progbits\n\t"	\
268
 	".section \".text16\", \"ax\", @progbits\n\t"	\

Loading…
Cancel
Save