io.h (3e4f384ed293f2f1d7a099d6fa652f414ee45a97) io.h (86845417d18994d0c0d14781a4a0d4bdfffc14ae)
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
5 * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice unmodified, this list of conditions, and the following
13 * disclaimer.

--- 87 unchanged lines hidden (view full) ---

101
102#undef iowrite32be
103static inline void
104iowrite32be(uint32_t v, volatile void *addr)
105{
106 *(volatile uint32_t *)addr = htobe32(v);
107}
108
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice unmodified, this list of conditions, and the following
13 * disclaimer.

--- 87 unchanged lines hidden (view full) ---

101
102#undef iowrite32be
103static inline void
104iowrite32be(uint32_t v, volatile void *addr)
105{
106 *(volatile uint32_t *)addr = htobe32(v);
107}
108
109#undef readb
110static inline uint8_t
111readb(const volatile void *addr)
112{
113 return *(const volatile uint8_t *)addr;
114}
115
116#undef readw
117static inline uint16_t
118readw(const volatile void *addr)
119{
120 return *(const volatile uint16_t *)addr;
121}
122
123#undef readl
124static inline uint32_t
125readl(const volatile void *addr)
126{
127 return *(const volatile uint32_t *)addr;
128}
129
130#if defined(__i386__) || defined(__amd64__)
109void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
131void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
132#else
133#define _ioremap_attr(...) NULL
134#endif
135
110#define ioremap_nocache(addr, size) \
111 _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE)
112#define ioremap_wc(addr, size) \
113 _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING)
136#define ioremap_nocache(addr, size) \
137 _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE)
138#define ioremap_wc(addr, size) \
139 _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING)
114#define ioremap ioremap_nocache
140#define ioremap(addr, size) \
141 _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE)
115void iounmap(void *addr);
116
117#define memset_io(a, b, c) memset((a), (b), (c))
118#define memcpy_fromio(a, b, c) memcpy((a), (b), (c))
119#define memcpy_toio(a, b, c) memcpy((a), (b), (c))
120
121static inline void
122__iowrite64_copy(void *to, void *from, size_t count)

--- 21 unchanged lines hidden ---
142void iounmap(void *addr);
143
144#define memset_io(a, b, c) memset((a), (b), (c))
145#define memcpy_fromio(a, b, c) memcpy((a), (b), (c))
146#define memcpy_toio(a, b, c) memcpy((a), (b), (c))
147
148static inline void
149__iowrite64_copy(void *to, void *from, size_t count)

--- 21 unchanged lines hidden ---