#include "dazuko_platform.h"#include "dazuko_xp.h"Go to the source code of this file.
Defines | |
| #define | call_xp_sys_hook xp_sys_hook |
| #define | call_xp_sys_unhook xp_sys_unhook |
| #define | call_xp_print xp_print |
Functions | |
| static int | call_xp_init_mutex (struct xp_mutex *mutex) |
| static int | call_xp_down (struct xp_mutex *mutex) |
| static int | call_xp_up (struct xp_mutex *mutex) |
| static int | call_xp_destroy_mutex (struct xp_mutex *mutex) |
| static int | call_xp_init_rwlock (struct xp_rwlock *rwlock) |
| static int | call_xp_write_lock (struct xp_rwlock *rwlock) |
| static int | call_xp_write_unlock (struct xp_rwlock *rwlock) |
| static int | call_xp_read_lock (struct xp_rwlock *rlock) |
| static int | call_xp_read_unlock (struct xp_rwlock *rlock) |
| static int | call_xp_destroy_rwlock (struct xp_rwlock *rwlock) |
| static int | call_xp_init_queue (struct xp_queue *queue) |
| static int | call_xp_wait_until_condition (struct xp_queue *queue, int(*cfunction)(void *), void *cparam, int allow_interrupt) |
| static int | call_xp_notify (struct xp_queue *queue) |
| static int | call_xp_destroy_queue (struct xp_queue *queue) |
| static void * | call_xp_malloc (size_t size) |
| static int | call_xp_free (void *ptr) |
| static int | call_xp_copyin (const void *user_src, void *kernel_dest, size_t size) |
| static int | call_xp_copyout (const void *kernel_src, void *user_dest, size_t size) |
| static int | call_xp_verify_user_writable (const void *user_ptr, size_t size) |
| static int | call_xp_verify_user_readable (const void *user_ptr, size_t size) |
| static int | call_xp_is_absolute_path (const char *path) |
| static int | call_xp_atomic_set (struct xp_atomic *atomic, int value) |
| static int | call_xp_atomic_inc (struct xp_atomic *atomic) |
| static int | call_xp_atomic_dec (struct xp_atomic *atomic) |
| static int | call_xp_atomic_read (struct xp_atomic *atomic) |
| static int | call_xp_copy_file (struct xp_file *dest, struct xp_file *src) |
| static int | call_xp_compare_file (struct xp_file *file1, struct xp_file *file2) |
| static int | call_xp_fill_file_struct (struct dazuko_file_struct *dfs) |
| static int | call_xp_id_compare (struct xp_daemon_id *id1, struct xp_daemon_id *id2) |
| static int | call_xp_id_free (struct xp_daemon_id *id) |
| static struct xp_daemon_id * | call_xp_id_copy (struct xp_daemon_id *id) |
|
|
Definition at line 52 of file dazuko_call.h. Referenced by _dazuko_find_slot(), _dazuko_unregister_daemon(), dazuko_exit(), dazuko_get_an_access(), dazuko_handle_request(), dazuko_handle_user_request_compat12(), dazuko_init(), dazuko_is_selected(), dazuko_register_daemon(), dazuko_set_option(), and dazuko_sys_pre(). |
|
|
Definition at line 50 of file dazuko_call.h. Referenced by dazuko_init(). |
|
|
Definition at line 51 of file dazuko_call.h. Referenced by dazuko_exit(). |
|
|
Definition at line 374 of file dazuko_call.h. References NULL, xp_atomic_dec(), and xp_print(). Referenced by _dazuko_unregister_daemon(). 00375 {
00376 if (atomic == NULL)
00377 {
00378 xp_print("dazuko: warning: xp_atomic_dec(NULL)\n");
00379 return -1;
00380 }
00381
00382 return xp_atomic_dec(atomic);
00383 }
|
|
|
Definition at line 363 of file dazuko_call.h. References NULL, xp_atomic_inc(), and xp_print(). Referenced by dazuko_register_daemon(). 00364 {
00365 if (atomic == NULL)
00366 {
00367 xp_print("dazuko: warning: xp_atomic_inc(NULL)\n");
00368 return -1;
00369 }
00370
00371 return xp_atomic_inc(atomic);
00372 }
|
|
|
Definition at line 385 of file dazuko_call.h. References NULL, xp_atomic_read(), and xp_print(). Referenced by _dazuko_unregister_daemon(), dazuko_exit(), dazuko_sys_check(), dazuko_sys_post(), and get_ready_slot_condition(). 00386 {
00387 if (atomic == NULL)
00388 {
00389 xp_print("dazuko: warning: xp_atomic_read(NULL)\n");
00390 return -1;
00391 }
00392
00393 return xp_atomic_read(atomic);
00394 }
|
|
||||||||||||
|
Definition at line 352 of file dazuko_call.h. References NULL, xp_atomic_set(), and xp_print(). Referenced by dazuko_init(), and dazuko_register_daemon(). 00353 {
00354 if (atomic == NULL)
00355 {
00356 xp_print("dazuko: warning: xp_atomic_set(atomic=NULL)\n");
00357 return -1;
00358 }
00359
00360 return xp_atomic_set(atomic, value);
00361 }
|
|
||||||||||||
|
Definition at line 416 of file dazuko_call.h. References NULL, xp_compare_file(), and xp_print(). Referenced by dazuko_get_hash(), dazuko_mark_hash_dirty(), and dazuko_sys_pre(). 00417 {
00418 if (file1 == NULL)
00419 {
00420 xp_print("dazuko: warning: xp_compare_file(file1=NULL)\n");
00421 return -1;
00422 }
00423
00424 if (file2 == NULL)
00425 {
00426 xp_print("dazuko: warning: xp_compare_file(file2=NULL)\n");
00427 return -1;
00428 }
00429
00430 return xp_compare_file(file1, file2);
00431 }
|
|
||||||||||||
|
Definition at line 399 of file dazuko_call.h. References NULL, xp_copy_file(), and xp_print(). Referenced by dazuko_add_hash(). 00400 {
00401 if (dest == NULL)
00402 {
00403 xp_print("dazuko: warning: xp_copy_file(dest=NULL)\n");
00404 return -1;
00405 }
00406
00407 if (src == NULL)
00408 {
00409 xp_print("dazuko: warning: xp_copy_file(src=NULL)\n");
00410 return -1;
00411 }
00412
00413 return xp_copy_file(dest, src);
00414 }
|
|
||||||||||||||||
|
Definition at line 255 of file dazuko_call.h. References NULL, xp_copyin(), and xp_print(). Referenced by dazuko_handle_user_request(), and dazuko_handle_user_request_compat12(). 00256 {
00257 if (user_src == NULL)
00258 {
00259 xp_print("dazuko: warning: xp_copyin(user_src=NULL)\n");
00260 return -1;
00261 }
00262
00263 if (kernel_dest == NULL)
00264 {
00265 xp_print("dazuko: warning: xp_copyin(kernel_dest=NULL)\n");
00266 return -1;
00267 }
00268
00269 if (size < 1)
00270 {
00271 xp_print("dazuko: warning: xp_copyin(size=%d)\n", size);
00272 return 0;
00273 }
00274
00275 return xp_copyin(user_src, kernel_dest, size);
00276 }
|
|
||||||||||||||||
|
Definition at line 278 of file dazuko_call.h. References NULL, xp_copyout(), and xp_print(). Referenced by dazuko_handle_user_request(), and dazuko_handle_user_request_compat12(). 00279 {
00280 if (kernel_src == NULL)
00281 {
00282 xp_print("dazuko: warning: xp_copyout(kernel_src=NULL)\n");
00283 return -1;
00284 }
00285
00286 if (user_dest == NULL)
00287 {
00288 xp_print("dazuko: warning: xp_copyout(user_dest=NULL)\n");
00289 return -1;
00290 }
00291
00292 if (size < 1)
00293 {
00294 xp_print("dazuko: warning: xp_copyout(size=%d)\n", size);
00295 return 0;
00296 }
00297
00298 return xp_copyout(kernel_src, user_dest, size);
00299 }
|
|
|
Definition at line 90 of file dazuko_call.h. References NULL, xp_destroy_mutex(), and xp_print(). Referenced by dazuko_exit(). 00091 {
00092 if (mutex == NULL)
00093 {
00094 xp_print("dazuko: warning: xp_destroy_mutex(NULL)\n");
00095 return -1;
00096 }
00097
00098 return xp_destroy_mutex(mutex);
00099 }
|
|
|
Definition at line 212 of file dazuko_call.h. References NULL, xp_destroy_queue(), and xp_print(). Referenced by dazuko_exit(). 00213 {
00214 if (queue == NULL)
00215 {
00216 xp_print("dazuko: warning: xp_destroy_queue(NULL)\n");
00217 return -1;
00218 }
00219
00220 return xp_destroy_queue(queue);
00221 }
|
|
|
Definition at line 159 of file dazuko_call.h. References NULL, xp_destroy_rwlock(), and xp_print(). Referenced by dazuko_exit(). 00160 {
00161 if (rwlock == NULL)
00162 {
00163 xp_print("dazuko: warning: xp_destroy_rwlock(NULL)\n");
00164 return -1;
00165 }
00166
00167 return xp_destroy_rwlock(rwlock);
00168 }
|
|
|
Definition at line 68 of file dazuko_call.h. References NULL, xp_down(), and xp_print(). Referenced by _dazuko_find_slot(), dazuko_change_slot_state(), dazuko_find_slot_and_slotlist(), dazuko_get_new_unique(), dazuko_register_daemon(), dazuko_run_daemon(), dazuko_run_daemon_on_slotlist(), and dazuko_slot_state(). 00069 {
00070 if (mutex == NULL)
00071 {
00072 xp_print("dazuko: warning: xp_down(NULL)\n");
00073 return -1;
00074 }
00075
00076 return xp_down(mutex);
00077 }
|
|
|
Definition at line 436 of file dazuko_call.h. References NULL, xp_fill_file_struct(), and xp_print(). Referenced by dazuko_should_scan(). 00437 {
00438 if (dfs == NULL)
00439 {
00440 xp_print("dazuko: warning: xp_fill_file_struct(NULL)\n");
00441 return -1;
00442 }
00443
00444 return xp_fill_file_struct(dfs);
00445 }
|
|
|
Definition at line 244 of file dazuko_call.h. References NULL, xp_free(), and xp_print(). Referenced by dazuko_exit(), dazuko_handle_request(), dazuko_handle_user_request(), dazuko_handle_user_request_compat12(), dazuko_insert_path_fs(), dazuko_register_daemon(), dazuko_remove_all_hash(), dazuko_remove_all_paths(), and dazuko_sys_post(). 00245 {
00246 if (ptr == NULL)
00247 {
00248 xp_print("dazuko: warning: xp_free(NULL)\n");
00249 return 0;
00250 }
00251
00252 return xp_free(ptr);
00253 }
|
|
||||||||||||
|
Definition at line 450 of file dazuko_call.h. References NULL, xp_id_compare(), and xp_print(). Referenced by _dazuko_find_slot(). 00451 {
00452 if (id1 == NULL)
00453 {
00454 xp_print("dazuko: warning: xp_id_compare(id1=NULL)\n");
00455 return -1;
00456 }
00457
00458 if (id2 == NULL)
00459 {
00460 xp_print("dazuko: warning: xp_id_compare(id2=NULL)\n");
00461 return -1;
00462 }
00463
00464 return xp_id_compare(id1, id2);
00465 }
|
|
|
Definition at line 478 of file dazuko_call.h. References NULL, xp_id_copy(), and xp_print(). Referenced by dazuko_handle_request(), dazuko_handle_user_request_compat12(), dazuko_is_our_daemon(), dazuko_register_daemon(), and dazuko_unregister_daemon(). 00479 {
00480 struct xp_daemon_id *ptr;
00481
00482 if (id == NULL)
00483 {
00484 xp_print("dazuko: warning: xp_id_copy(NULL)\n");
00485 return NULL;
00486 }
00487
00488 ptr = xp_id_copy(id);
00489
00490 if (ptr == NULL)
00491 xp_print("dazuko: warning: xp_id_copy() -> NULL\n");
00492
00493 return ptr;
00494 }
|
|
|
Definition at line 467 of file dazuko_call.h. References NULL, xp_id_free(), and xp_print(). Referenced by _dazuko_unregister_daemon(), dazuko_handle_request(), dazuko_handle_user_request_compat12(), dazuko_is_our_daemon(), and dazuko_unregister_daemon(). 00468 {
00469 if (id == NULL)
00470 {
00471 xp_print("dazuko: warning: xp_id_free(NULL)\n");
00472 return 0;
00473 }
00474
00475 return xp_id_free(id);
00476 }
|
|
|
Definition at line 57 of file dazuko_call.h. References NULL, xp_init_mutex(), and xp_print(). Referenced by dazuko_init(), and dazuko_register_daemon(). 00058 {
00059 if (mutex == NULL)
00060 {
00061 xp_print("dazuko: xp_init_mutex(NULL)\n");
00062 return -1;
00063 }
00064
00065 return xp_init_mutex(mutex);
00066 }
|
|
|
Definition at line 173 of file dazuko_call.h. References NULL, xp_init_queue(), and xp_print(). Referenced by dazuko_init(). 00174 {
00175 if (queue == NULL)
00176 {
00177 xp_print("dazuko: warning: xp_init_queue(NULL)\n");
00178 return -1;
00179 }
00180
00181 return xp_init_queue(queue);
00182 }
|
|
|
Definition at line 104 of file dazuko_call.h. References NULL, xp_init_rwlock(), and xp_print(). Referenced by dazuko_init(). 00105 {
00106 if (rwlock == NULL)
00107 {
00108 xp_print("dazuko: warning: xp_init_rwlock(NULL)\n");
00109 return -1;
00110 }
00111
00112 return xp_init_rwlock(rwlock);
00113 }
|
|
|
Definition at line 338 of file dazuko_call.h. References NULL, xp_is_absolute_path(), and xp_print(). Referenced by dazuko_insert_path_fs(). 00339 {
00340 if (path == NULL)
00341 {
00342 xp_print("dazuko: warning: xp_is_absolute_path(NULL)\n");
00343 return 0;
00344 }
00345
00346 return xp_is_absolute_path(path);
00347 }
|
|
|
Definition at line 226 of file dazuko_call.h. References NULL, xp_malloc(), and xp_print(). Referenced by dazuko_add_hash(), dazuko_get_value(), dazuko_handle_user_request(), dazuko_handle_user_request_compat12(), dazuko_insert_path_fs(), dazuko_register_daemon(), and dazuko_sys_pre(). 00227 {
00228 void *ptr;
00229
00230 if (size < 1)
00231 {
00232 xp_print("dazuko: warning: xp_malloc(%d)\n", size);
00233 return NULL;
00234 }
00235
00236 ptr = xp_malloc(size);
00237
00238 if (ptr == NULL)
00239 xp_print("dazuko: warning: xp_malloc(%d) -> NULL\n", size);
00240
00241 return ptr;
00242 }
|
|
|
Definition at line 201 of file dazuko_call.h. References NULL, xp_notify(), and xp_print(). Referenced by __dazuko_change_slot_state(), _dazuko_unregister_daemon(), dazuko_get_an_access(), dazuko_return_access(), dazuko_run_daemon_on_slotlist(), and dazuko_state_error(). 00202 {
00203 if (queue == NULL)
00204 {
00205 xp_print("dazuko: warning: xp_notify(NULL)\n");
00206 return -1;
00207 }
00208
00209 return xp_notify(queue);
00210 }
|
|
|
Definition at line 137 of file dazuko_call.h. References NULL, xp_print(), and xp_read_lock(). Referenced by dazuko_is_selected(), and dazuko_sys_pre(). 00138 {
00139 if (rlock == NULL)
00140 {
00141 xp_print("dazuko: warning: xp_read_lock(NULL)\n");
00142 return -1;
00143 }
00144
00145 return xp_read_lock(rlock);
00146 }
|
|
|
Definition at line 148 of file dazuko_call.h. References NULL, xp_print(), and xp_read_unlock(). Referenced by dazuko_is_selected(), and dazuko_sys_pre(). 00149 {
00150 if (rlock == NULL)
00151 {
00152 xp_print("dazuko: warning: xp_read_unlock(NULL)\n");
00153 return -1;
00154 }
00155
00156 return xp_read_unlock(rlock);
00157 }
|
|
|
Definition at line 79 of file dazuko_call.h. References NULL, xp_print(), and xp_up(). Referenced by _dazuko_find_slot(), _dazuko_unregister_daemon(), dazuko_change_slot_state(), dazuko_find_slot_and_slotlist(), dazuko_get_new_unique(), dazuko_handle_request(), dazuko_handle_user_request_compat12(), dazuko_register_daemon(), dazuko_return_access(), dazuko_run_daemon(), dazuko_run_daemon_on_slotlist(), and dazuko_slot_state(). 00080 {
00081 if (mutex == NULL)
00082 {
00083 xp_print("dazuko: warning: xp_up(NULL)\n");
00084 return -1;
00085 }
00086
00087 return xp_up(mutex);
00088 }
|
|
||||||||||||
|
Definition at line 318 of file dazuko_call.h. References NULL, xp_print(), and xp_verify_user_readable(). Referenced by dazuko_handle_user_request_compat12(). 00319 {
00320 if (user_ptr == NULL)
00321 {
00322 xp_print("dazuko: warning: xp_verify_user_readable(user_ptr=NULL)\n");
00323 return -1;
00324 }
00325
00326 if (size < 1)
00327 {
00328 xp_print("dazuko: warning: xp_verify_user_readable(size=%d)\n", size);
00329 return -1;
00330 }
00331
00332 return xp_verify_user_readable(user_ptr, size);
00333 }
|
|
||||||||||||
|
Definition at line 301 of file dazuko_call.h. References NULL, xp_print(), and xp_verify_user_writable(). Referenced by dazuko_handle_user_request_compat12(). 00302 {
00303 if (user_ptr == NULL)
00304 {
00305 xp_print("dazuko: warning: xp_verify_user_writable(user_ptr=NULL)\n");
00306 return -1;
00307 }
00308
00309 if (size < 1)
00310 {
00311 xp_print("dazuko: warning: xp_verify_user_writable(size=%d)\n", size);
00312 return -1;
00313 }
00314
00315 return xp_verify_user_writable(user_ptr, size);
00316 }
|
|
||||||||||||||||||||
|
Definition at line 184 of file dazuko_call.h. References NULL, xp_print(), and xp_wait_until_condition(). Referenced by dazuko_get_an_access(), dazuko_return_access(), and dazuko_run_daemon_on_slotlist(). 00185 {
00186 if (queue == NULL)
00187 {
00188 xp_print("dazuko: warning: xp_wait_until_condition(queue=NULL)\n");
00189 return -1;
00190 }
00191
00192 if (cfunction == NULL)
00193 {
00194 xp_print("dazuko: warning: xp_wait_until_condition(cfunction=NULL)\n");
00195 return -1;
00196 }
00197
00198 return xp_wait_until_condition(queue, cfunction, cparam, allow_interrupt);
00199 }
|
|
|
Definition at line 115 of file dazuko_call.h. References NULL, xp_print(), and xp_write_lock(). Referenced by dazuko_add_hash(), dazuko_get_hash(), dazuko_insert_path_fs(), dazuko_mark_hash_dirty(), dazuko_remove_all_hash(), and dazuko_remove_all_paths(). 00116 {
00117 if (rwlock == NULL)
00118 {
00119 xp_print("dazuko: warning: xp_write_lock(NULL)\n");
00120 return -1;
00121 }
00122
00123 return xp_write_lock(rwlock);
00124 }
|
|
|
Definition at line 126 of file dazuko_call.h. References NULL, xp_print(), and xp_write_unlock(). Referenced by dazuko_add_hash(), dazuko_get_hash(), dazuko_insert_path_fs(), dazuko_mark_hash_dirty(), dazuko_remove_all_hash(), and dazuko_remove_all_paths(). 00127 {
00128 if (rwlock == NULL)
00129 {
00130 xp_print("dazuko: warning: xp_write_unlock(NULL)\n");
00131 return -1;
00132 }
00133
00134 return xp_write_unlock(rwlock);
00135 }
|
1.4.2