|
@@ -82,6 +82,18 @@ trivial_userptr_add ( userptr_t userptr, off_t offset ) {
|
82
|
82
|
return ( userptr + offset );
|
83
|
83
|
}
|
84
|
84
|
|
|
85
|
+/**
|
|
86
|
+ * Subtract user pointers
|
|
87
|
+ *
|
|
88
|
+ * @v userptr User pointer
|
|
89
|
+ * @v subtrahend User pointer to be subtracted
|
|
90
|
+ * @ret offset Offset
|
|
91
|
+ */
|
|
92
|
+static inline __always_inline off_t
|
|
93
|
+trivial_userptr_sub ( userptr_t userptr, userptr_t subtrahend ) {
|
|
94
|
+ return ( userptr - subtrahend );
|
|
95
|
+}
|
|
96
|
+
|
85
|
97
|
/**
|
86
|
98
|
* Copy data between user buffers
|
87
|
99
|
*
|
|
@@ -239,6 +251,15 @@ void * user_to_virt ( userptr_t userptr, off_t offset );
|
239
|
251
|
*/
|
240
|
252
|
userptr_t userptr_add ( userptr_t userptr, off_t offset );
|
241
|
253
|
|
|
254
|
+/**
|
|
255
|
+ * Subtract user pointers
|
|
256
|
+ *
|
|
257
|
+ * @v userptr User pointer
|
|
258
|
+ * @v subtrahend User pointer to be subtracted
|
|
259
|
+ * @ret offset Offset
|
|
260
|
+ */
|
|
261
|
+off_t userptr_sub ( userptr_t userptr, userptr_t subtrahend );
|
|
262
|
+
|
242
|
263
|
/**
|
243
|
264
|
* Convert virtual address to a physical address
|
244
|
265
|
*
|