diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2008-08-16 15:17:36 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2008-08-16 15:17:36 +0000 |
commit | f394c7593f21edcce71f287e12ba61072203ea3d (patch) | |
tree | 8f1fc01597f8855bd3b556e9e4c620c861507225 /payloads/libpayload/include | |
parent | 11e45cd3ff43401e4eb8a58b71638b6922d4595c (diff) |
add block io functions
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3513 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r-- | payloads/libpayload/include/arch/io.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/payloads/libpayload/include/arch/io.h b/payloads/libpayload/include/arch/io.h index 538b296a11..31a8f88410 100644 --- a/payloads/libpayload/include/arch/io.h +++ b/payloads/libpayload/include/arch/io.h @@ -2,6 +2,7 @@ * This file is part of the libpayload project. * * Copyright (C) 2008 Advanced Micro Devices, Inc. + * Copyright (C) 2008 coresystems GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -74,4 +75,34 @@ static inline void outb(unsigned char val, int port) __asm__ __volatile__("outb %b0, %w1" : : "a"(val), "Nd"(port)); } +static inline void outsl(int port, const void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; outsl" : "+S"(addr), "+c"(count) : "d"(port)); +} + +static inline void outsw(int port, const void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; outsw" : "+S"(addr), "+c"(count) : "d"(port)); +} + +static inline void outsb(int port, const void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; outsb" : "+S"(addr), "+c"(count) : "d"(port)); +} + +static inline void insl(int port, void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; insl" : "+D"(addr), "+c"(count) : "d"(port)); +} + +static inline void insw(int port, void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; insw" : "+D"(addr), "+c"(count) : "d"(port)); +} + +static inline void insb(int port, void *addr, unsigned long count) +{ + __asm__ __volatile__("rep; insb" : "+D"(addr), "+c"(count) : "d"(port)); +} + #endif |