1 /******************************************************************************
2 * Copyright (c) 2007, 2012, 2013 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
21 extern uint32_t SLOF_GetTimer(void);
22 extern void SLOF_msleep(uint32_t time);
23 extern void SLOF_usleep(uint32_t time);
24 extern void *SLOF_dma_alloc(long size);
25 extern void SLOF_dma_free(void *virt, long size);
26 extern void *SLOF_alloc_mem(long size);
27 extern void *SLOF_alloc_mem_aligned(long size, long align);
28 extern void SLOF_free_mem(void *addr, long size);
29 extern long SLOF_dma_map_in(void *virt, long size, int cacheable);
30 extern void SLOF_dma_map_out(long phys, void *virt, long size);
31 extern long SLOF_pci_config_read32(long offset);
32 extern long SLOF_pci_config_read16(long offset);
33 extern long SLOF_pci_config_read8(long offset);
34 extern void SLOF_pci_config_write32(long offset, long value);
35 extern void SLOF_pci_config_write16(long offset, long value);
36 extern void SLOF_pci_config_write8(long offset, long value);
37 extern void *SLOF_translate_my_address(void *addr);
39 #define offset_of(type, member) ((long) &((type *)0)->member)
40 #define container_of(ptr, type, member) ({ \
41 const typeof(((type *)0)->member)* struct_ptr = (ptr); \
42 (type *)((char *)struct_ptr - offset_of(type, member)); })