Browse Source

libaio: initial package

lilik-openwrt-22.03
Steven Barth 11 years ago
parent
commit
b07194e5a8
3 changed files with 1284 additions and 0 deletions
  1. +62
    -0
      libs/libaio/Makefile
  2. +1098
    -0
      libs/libaio/patches/001-arches_from_debian_package_0.3.109-4.patch
  3. +124
    -0
      libs/libaio/patches/002-avr32_support.patch

+ 62
- 0
libs/libaio/Makefile View File

@ -0,0 +1,62 @@
#
# Copyright (C) 2007-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libaio
PKG_VERSION:=0.3.109
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
PKG_MD5SUM:=435a5b16ca6198eaf01155263d855756
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
define Package/libaio
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Linux kernel AIO interface access library
URL:=http://lse.sourceforge.net/io/aio.html
endef
define Build/Configure
endef
LIBAIO_CFLAGS:=-nostdlib -nostartfiles -I. $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)
TARGET_CFLAGS += $(FPIC)
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
ARCH="$(ARCH)" \
CC="$(TARGET_CROSS)gcc" \
LD="$(TARGET_CROSS)ld" \
CFLAGS="$(LIBAIO_CFLAGS)" \
all
$(MAKE) -C $(PKG_BUILD_DIR) \
prefix="$(PKG_INSTALL_DIR)/usr" \
install
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libaio.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.{a,so*} $(1)/usr/lib/
endef
define Package/libaio/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libaio))

+ 1098
- 0
libs/libaio/patches/001-arches_from_debian_package_0.3.109-4.patch
File diff suppressed because it is too large
View File


+ 124
- 0
libs/libaio/patches/002-avr32_support.patch View File

@ -0,0 +1,124 @@
Index: libaio-0.3.109/src/libaio.h
===================================================================
--- libaio-0.3.109.orig/src/libaio.h 2014-06-11 10:41:12.537824814 +0200
+++ libaio-0.3.109/src/libaio.h 2014-06-11 10:41:12.537824814 +0200
@@ -134,6 +134,10 @@
#define PADDEDptr(x, y) x
#define PADDEDul(x, y) unsigned long x
# endif
+#elif defined(__avr32__) /* big endian, 32 bits */
+#define PADDED(x, y) unsigned y; x
+#define PADDEDptr(x, y) unsigned y; x
+#define PADDEDul(x, y) unsigned y; unsigned long x;
#else
#error endian?
#endif
Index: libaio-0.3.109/src/syscall-avr32.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ libaio-0.3.109/src/syscall-avr32.h 2014-06-11 10:41:12.537824814 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2007 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define __NR_io_setup 197
+#define __NR_io_destroy 198
+#define __NR_io_getevents 199
+#define __NR_io_submit 200
+#define __NR_io_cancel 201
+
+#define io_syscall1(type,fname,sname,type1,arg1) \
+type fname(type1 arg1) \
+{ \
+ register long __r12 __asm__("r12") = (long)arg1; \
+ register long __res_r12 __asm__("r12"); \
+ register long __scno __asm__("r8") = __NR_##sname; \
+ __asm__ __volatile__("scall" \
+ : "=r"(__res_r12) \
+ : "0"(__r12), "r"(__scno) \
+ : "memory"); \
+ return (type) __res_r12; \
+}
+
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
+type fname(type1 arg1, type2 arg2) \
+{ \
+ register long __r12 __asm__("r12") = (long)arg1; \
+ register long __r11 __asm__("r11") = (long)arg2; \
+ register long __res_r12 __asm__("r12"); \
+ register long __scno __asm__("r8") = __NR_##sname; \
+ __asm__ __volatile__("scall" \
+ : "=r"(__res_r12) \
+ : "0"(__r12), "r"(__r11), "r"(__scno) \
+ : "memory"); \
+ return (type) __res_r12; \
+}
+
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
+type fname(type1 arg1, type2 arg2, type3 arg3) \
+{ \
+ register long __r12 __asm__("r12") = (long)arg1; \
+ register long __r11 __asm__("r11") = (long)arg2; \
+ register long __r10 __asm__("r10") = (long)arg3; \
+ register long __res_r12 __asm__("r12"); \
+ register long __scno __asm__("r8") = __NR_##sname; \
+ __asm__ __volatile__("scall" \
+ : "=r"(__res_r12) \
+ : "0"(__r12), "r"(__r11), "r"(__r10), \
+ "r"(__scno) \
+ : "memory"); \
+ return (type) __res_r12; \
+}
+
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+ register long __r12 __asm__("r12") = (long)arg1; \
+ register long __r11 __asm__("r11") = (long)arg2; \
+ register long __r10 __asm__("r10") = (long)arg3; \
+ register long __r9 __asm__("r9") = (long)arg4; \
+ register long __res_r12 __asm__("r12"); \
+ register long __scno __asm__("r8") = __NR_##sname; \
+ __asm__ __volatile__("scall" \
+ : "=r"(__res_r12) \
+ : "0"(__r12), "r"(__r11), "r"(__r10), \
+ "r"(__r9), "r"(__scno) \
+ : "memory"); \
+ return (type) __res_r12; \
+}
+
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
+{ \
+ register long __r12 __asm__("r12") = (long)arg1; \
+ register long __r11 __asm__("r11") = (long)arg2; \
+ register long __r10 __asm__("r10") = (long)arg3; \
+ register long __r9 __asm__("r9") = (long)arg4; \
+ register long __r5 __asm__("r5") = (long)arg5; \
+ register long __res_r12 __asm__("r12"); \
+ register long __scno __asm__("r8") = __NR_##sname; \
+ __asm__ __volatile__("scall" \
+ : "=r"(__res_r12) \
+ : "0"(__r12), "r"(__r11), "r"(__r10), \
+ "r"(__r9), "r"(__r5), "r"(__scno) \
+ : "memory"); \
+ return (type) __res_r12; \
+}
Index: libaio-0.3.109/src/syscall.h
===================================================================
--- libaio-0.3.109.orig/src/syscall.h 2014-06-11 10:41:12.537824814 +0200
+++ libaio-0.3.109/src/syscall.h 2014-06-11 10:41:12.537824814 +0200
@@ -38,6 +38,8 @@
#include "syscall-sh.h"
#elif defined(__aarch64__)
#include "syscall-arm64.h"
+#elif defined(__avr32__)
+#include "syscall-avr32.h"
#else
#error "add syscall-arch.h"
#endif

Loading…
Cancel
Save