Executing a user-space function from the kernel space

前端 未结 4 622
一整个雨季
一整个雨季 2020-12-03 19:19

Im writing a custom device driver in linux that has to be able to respond very rapidly on interrupts. Code to handle this already exists in a user-space implementation but t

4条回答
  •  北海茫月
    2020-12-03 19:40

    Sounds like your interrupt line is already available to userspace via gpiolib? (/sys/class/gpio/...)

    Have you benchmarked if gpio edge triggering and poll() is fast enough for you? That way you don't have to poll the status from the userspace application but edge triggering will report it via poll(). See Documentation/gpio.txt in kernel source.

    If the edge triggering via sysfs is not good enough, then the proper way is to develop a kernel driver that takes care of the time critical part and exports the results to userspace via a API (sysfs, device node, etc).

提交回复
热议问题