|
@@ -126,6 +126,23 @@ trivial_memmove_user ( userptr_t dest, off_t dest_off,
|
126
|
126
|
( ( void * ) src + src_off ), len );
|
127
|
127
|
}
|
128
|
128
|
|
|
129
|
+/**
|
|
130
|
+ * Compare data between user buffers
|
|
131
|
+ *
|
|
132
|
+ * @v first First buffer
|
|
133
|
+ * @v first_off First buffer offset
|
|
134
|
+ * @v second Second buffer
|
|
135
|
+ * @v second_off Second buffer offset
|
|
136
|
+ * @v len Length
|
|
137
|
+ * @ret diff Difference
|
|
138
|
+ */
|
|
139
|
+static inline __always_inline int
|
|
140
|
+trivial_memcmp_user ( userptr_t first, off_t first_off,
|
|
141
|
+ userptr_t second, off_t second_off, size_t len ) {
|
|
142
|
+ return memcmp ( ( ( void * ) first + first_off ),
|
|
143
|
+ ( ( void * ) second + second_off ), len );
|
|
144
|
+}
|
|
145
|
+
|
129
|
146
|
/**
|
130
|
147
|
* Fill user buffer with a constant byte
|
131
|
148
|
*
|
|
@@ -333,6 +350,19 @@ copy_from_user ( void *dest, userptr_t src, off_t src_off, size_t len ) {
|
333
|
350
|
void memmove_user ( userptr_t dest, off_t dest_off,
|
334
|
351
|
userptr_t src, off_t src_off, size_t len );
|
335
|
352
|
|
|
353
|
+/**
|
|
354
|
+ * Compare data between user buffers
|
|
355
|
+ *
|
|
356
|
+ * @v first First buffer
|
|
357
|
+ * @v first_off First buffer offset
|
|
358
|
+ * @v second Second buffer
|
|
359
|
+ * @v second_off Second buffer offset
|
|
360
|
+ * @v len Length
|
|
361
|
+ * @ret diff Difference
|
|
362
|
+ */
|
|
363
|
+int memcmp_user ( userptr_t first, off_t first_off,
|
|
364
|
+ userptr_t second, off_t second_off, size_t len );
|
|
365
|
+
|
336
|
366
|
/**
|
337
|
367
|
* Fill user buffer with a constant byte
|
338
|
368
|
*
|