1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-20 07:38:40 +02:00
openwrt-packages/utils/io/Makefile
Hauke Mehrtens 90df0f3e24 io: Open /dev/mem with O_SYNC for uncached access
Only when /dev/mem is opened with O_SYNC the write and *read* is done
uncached. We saw wrong values read out from the hardware without setting
O_SYNC, the busybox devmem tool showed different values, when O_SYNC is
also set for the io tool, it reads out the same values as devmem.
When looking at the drivers/char/mem.c file in the kernel it is behaving
differently based on the O_DSYNC flag.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2019-07-24 13:57:09 +02:00

37 lines
855 B
Makefile

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=io
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
define Package/io
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Raw memory i/o utility
URL:=http://www.sleepie.demon.co.uk/linuxvme/io.c
endef
define Package/io/description
This tool can be used to access physical memory addresses from userspace.
It can be useful to access hardware for which no device driver exists!
endef
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) -Wall $(PKG_BUILD_DIR)/io.c -o $(PKG_BUILD_DIR)/$(PKG_NAME)
endef
define Package/io/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/io $(1)/usr/bin/
endef
$(eval $(call BuildPackage,io))