Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:zhonghuaren
linuxcnc
aarch64-io.h
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File aarch64-io.h of Package linuxcnc
/* A largely dummy io.h to statisfy the requirements of Machinekit on aarch64 The functions still require a valid base address, which appears to be #define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M)) MODULES_VADDR being the address at which insmod begins loading kernel modules */ #ifndef _SYS_IO_H #define _SYS_IO_H #include <features.h> // as per arch/.../memory.txt #define PCI_IOBASE 0xfee00000UL // ((void __iomem *)(MODULES_VADDR - SZ_2M)) //((void __iomem *)PCI_IO_START) __BEGIN_DECLS /* If TURN_ON is TRUE, request for permission to do direct i/o on the port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O permission off for that range. This call requires root privileges. Portability note: not all Linux platforms support this call. Most platforms based on the PC I/O architecture probably will, however. E.g., Linux/Alpha for Alpha PCs supports this. */ //extern int ioperm (unsigned long int __from, unsigned long int __num, // int __turn_on) __THROW; /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root privileges. */ // Does not appear this call is supported // dummy function to return 0 (success and keep pci_write happy //int iopl(int __level) { return 0; } #if defined __GNUC__ && __GNUC__ >= 2 // Does not appear this call is supported // dummy function to return 0 (success and keep pci_write happy static __inline int iopl(int __level) { return 0; } static __inline unsigned char inb (unsigned short int __port) { unsigned char val; unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("ldrb %w0, [%1]" : "=r" (val) : "r" (addr)); return val; } static __inline unsigned short int inw (unsigned short int __port) { unsigned short val; unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("ldrh %w0, [%1]" : "=r" (val) : "r" (addr)); return val; } static __inline unsigned int inl (unsigned short int __port) { unsigned int val; unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("ldrh %w0, [%1]" : "=r" (val) : "r" (addr)); return val; } /////////////////////////////////////////////////////////////////// static __inline void outb (unsigned char __value, unsigned short int __port) { unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("strb %w0, [%1]" : : "r" (__value), "r" (addr)); } static __inline void outw (unsigned short int __value, unsigned short int __port) { unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("strh %w0, [%1]" : : "r" (__value), "r" (addr)); } static __inline void outl (unsigned int __value, unsigned short int __port) { unsigned long addr = ((unsigned long) __port + PCI_IOBASE); asm volatile("strh %w0, [%1]" : : "r" (__value), "r" (addr)); } #endif /* GNU C */ __END_DECLS #endif /* _SYS_IO_H */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor