hi ,in sys_ipc_wrapper, the code first get the current thread's syscall entry frame: .... Thread *curr=current_thread(); Syscall_frame *f = curr-regs(); ...
according to the Syscall_frame's implemention, it can get the Utcb by Syscall_frame::utcb().
but the following code get the Utcb in another way:
Utcb *utcb = curr->utcb().access(true);
what's the difference between those two Utcb?
On Tue May 12, 2015 at 11:01:13 +0800, watermirror wrote:
hi ,in sys_ipc_wrapper, the code first get the current thread's syscall entry frame: .... Thread *curr=current_thread(); Syscall_frame *f = curr-regs(); ...
according to the Syscall_frame's implemention, it can get the Utcb by Syscall_frame::utcb().
but the following code get the Utcb in another way:
Utcb *utcb = curr->utcb().access(true);
what's the difference between those two Utcb?
Specifying the utcb via the syscall is not used currently, there's just one.
Adam
Hi,
I have designed a device in FPGA. This device has only one register and this register is mapped to physical address 0x41200000. I can operate this address in kernel level. And now I want to write a driver to operate this device. Because the driver runs at application level and I can just operate virtual address. I want to know how to map this physical address 0x41200000 to driver virtual address so I can operate this device in the application driver. Thanks a lot.
Best, Jian
Hi,
On 05/19/2015 09:00 PM, qxjsjjjz wrote:
Hi,
I have designed a device in FPGA. This device has only one register and this register is mapped to physical address 0x41200000. I can operate this address in kernel level. And now I want to write a driver to operate this device. Because the driver runs at application level and I can just operate virtual address. I want to know how to map this physical address 0x41200000 to driver virtual address so I can operate this device in the application driver. Thanks a lot.
You have to take the following steps.
1. Add a new hardware device to your device tree and add a Mmio resource to it. 2. Create a vbus for your user level driver and assign the hardware device to it. 3. In your user level driver, query the vbus for devices and their associated resources using the vbus API. 4. Map the Mmio resource from your hardware device into the address space of your user level driver.
Now you can access the registers a the mapped (=virtual) address.
Best, Matthias.
On Tue May 19, 2015 at 12:00:48 -0700, qxjsjjjz wrote:
I have designed a device in FPGA. This device has only one register and this register is mapped to physical address 0x41200000. I can operate this address in kernel level. And now I want to write a driver to operate this device. Because the driver runs at application level and I can just operate virtual address. I want to know how to map this physical address 0x41200000 to driver virtual address so I can operate this device in the application driver. Thanks a lot.
See the arm-rv* files in conf/examples on how to specify the mmio at 0x41200000 in your application's vbus and how to use io. Then use l4io_request_iomem(0x41200000, 0x1000, 0, &virtaddr) to get a virtual address to use.
Adam
l4-hackers@os.inf.tu-dresden.de