xref: /haiku/src/add-ons/kernel/busses/scsi/ahci/util.h (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
1 /*
2  * Copyright 2004-2007, Marcus Overhagen. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef __UTIL_H
6 #define __UTIL_H
7 
8 #include <KernelExport.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 area_id alloc_mem(void **virt, phys_addr_t *phy, size_t size, uint32 protection,
15 			const char *name);
16 area_id map_mem(void **virt, phys_addr_t phy, size_t size, uint32 protection,
17 			const char *name);
18 
19 status_t sg_memcpy(const physical_entry *sgTable, int sgCount, const void *data, size_t dataSize);
20 
21 void swap_words(void *data, size_t size);
22 
23 int fls(unsigned mask);
24 
25 #ifdef __cplusplus
26 }
27 #endif
28 
29 #endif
30