summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-03-31 12:21:47 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-05-02 16:24:05 +1000
commit322e6efc7802b6df2520bd1f89342ad4c7ca30be (patch)
tree4ed180a2087e8fc5d32197db00fefcb6cdb3a516 /lib
parenta13aacdd9a677f36c71fba06ca24158ea98cda1f (diff)
downloadnouveau-322e6efc7802b6df2520bd1f89342ad4c7ca30be.tar.gz
lib: fix build on ppc
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/core/os.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/lib/core/os.h b/lib/core/os.h
index 6f4b4dc9f..1a60d78bb 100644
--- a/lib/core/os.h
+++ b/lib/core/os.h
@@ -114,10 +114,12 @@ order_base_2(u64 base)
* endianness
*****************************************************************************/
-#define le16_to_cpu(a) (a)
-#define le32_to_cpu(a) (a)
-#define cpu_to_le16(a) (a)
-#define cpu_to_le32(a) (a)
+#include <endian.h>
+
+#define le16_to_cpu(a) le16toh(a)
+#define le32_to_cpu(a) le32toh(a)
+#define cpu_to_le16(a) htole16(a)
+#define cpu_to_le32(a) htole32(a)
/******************************************************************************
* unaligned access
@@ -579,6 +581,19 @@ resource_size(const struct resource *res)
}
/******************************************************************************
+ * OpenFirmware
+ *****************************************************************************/
+
+struct device_node {
+};
+
+static inline const void *
+of_get_property(const struct device_node *dn, const char *name, int *lenp)
+{
+ return NULL;
+}
+
+/******************************************************************************
* PCI
*****************************************************************************/
#include <pciaccess.h>
@@ -596,6 +611,12 @@ struct pci_dev {
int irq;
};
+static inline struct device_node *
+pci_device_to_OF_node(const struct pci_dev *pdev)
+{
+ return NULL;
+}
+
static inline int
pci_find_capability(struct pci_dev *pdev, int cap)
{
@@ -1006,5 +1027,12 @@ orderly_poweroff(bool force)
BUG_ON(1);
}
+/******************************************************************************
+ * endianness (cont'd)
+ *****************************************************************************/
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#undef __BIG_ENDIAN
#endif
+
+#endif