summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-09-18 09:24:10 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-12-02 15:37:18 +1000
commitc87beb00c3b23ab851b0b06df4aba1dbc15d76ff (patch)
tree885c2f10419e08693001c472d80d005e8f23a259 /lib
parentae9ade0a321a70263e514c9c790d941bf0e5e8a6 (diff)
downloadnouveau-c87beb00c3b23ab851b0b06df4aba1dbc15d76ff.tar.gz
bios: split out shadow methods
We're about to need to be able to fetch additional chunks of data beyond the primary bios image, which makes fetching a lot more complicated. This splits out the verious shadowing routines to be nothing more than very dumb "fetch this much data from this offset" routines, and leaves the logic of what and how much to fetch in common code. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/core/os.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/core/os.h b/lib/core/os.h
index fba954229..e3fb9e4d3 100644
--- a/lib/core/os.h
+++ b/lib/core/os.h
@@ -79,6 +79,10 @@ typedef dma_addr_t resource_size_t;
#define unlikely(a) (a)
#define BIT(a) (1UL << (a))
+#define ERR_PTR(err) ((void *)(long)(err))
+#define PTR_ERR(ptr) ((long)(ptr))
+#define IS_ERR(ptr) ((unsigned long)(ptr) >= (unsigned long)-4095)
+
#define jiffies (ktime_to_ns(ktime_get()))
#define nsecs_to_jiffies(a) (a)
#define usecs_to_jiffies(a) nsecs_to_jiffies((a) * 1000)