mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-18 17:24:04 +01:00
* enabled -O2 for ctb and mythen + a few additional warnings (cherry picked from commit4d2f37c205) * configure stack size for blackfin servers to 256kB instead of the default 4kB (cherry picked from commit5468b1e4dd) * enable opt for JF and Moench, ratemax make local for eiger (cherry picked from commit5500800503) * fixed misplaced volatile on Beb_Read32 (cherry picked from commit7b9f408df1) * removed dead code in eiger server (which had 2 byte read passt end) 10.1.0.rc: only the Eiger part of the original commit is applied. The usleep_bf change (return -1 for sleeps that cannot be represented) does not apply, usleep_bf does not exist on this branch. (cherry picked from commit8e24c0196f) * deal with fall through of table filling in ratecorr table (cherry picked from commitf69856b5ff) * memory clobber for inline asm and added flags on eiger (cherry picked from commita8c391509e) * -O2 for gotthard and xilinx (cherry picked from commitbf73241a47) * fixes to remove the new warnings (cherry picked from commiteb525e96be) * fixed new eiger warnings (cherry picked from commit9c86c36534) * binaries in * fixes for warnings (already in developer from list.h separation PR) --------- Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
79 lines
2.6 KiB
C
79 lines
2.6 KiB
C
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#include "HardwareIO.h"
|
|
|
|
xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress) {
|
|
/* read the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
xfs_u8 IoContents;
|
|
__asm__ volatile("eieio; lbz %0,0(%1)"
|
|
: "=r"(IoContents)
|
|
: "b"(InAddress)
|
|
: "memory");
|
|
return IoContents;
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
|
|
xfs_u16 HWIO_xfs_in16(xfs_u32 InAddress) {
|
|
/* read the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
xfs_u16 IoContents;
|
|
__asm__ volatile("eieio; lhz %0,0(%1)"
|
|
: "=r"(IoContents)
|
|
: "b"(InAddress)
|
|
: "memory");
|
|
return IoContents;
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
|
|
xfs_u32 HWIO_xfs_in32(xfs_u32 InAddress) {
|
|
/* read the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
xfs_u32 IoContents;
|
|
__asm__ volatile("eieio; lwz %0,0(%1)"
|
|
: "=r"(IoContents)
|
|
: "b"(InAddress)
|
|
: "memory");
|
|
return IoContents;
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
|
|
void HWIO_xfs_out8(xfs_u32 OutAddress, xfs_u8 Value) {
|
|
/* write the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
__asm__ volatile("stb %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress)
|
|
: "memory");
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
void HWIO_xfs_out16(xfs_u32 OutAddress, xfs_u16 Value) {
|
|
/* write the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
__asm__ volatile("sth %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress)
|
|
: "memory");
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
|
|
void HWIO_xfs_out32(xfs_u32 OutAddress, xfs_u32 Value) {
|
|
/* write the contents of the I/O location and then synchronize the I/O
|
|
* such that the I/O operation completes before proceeding on
|
|
*/
|
|
|
|
__asm__ volatile("stw %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress)
|
|
: "memory");
|
|
}
|