libsoc: C library for interfacing with common SoC peripherals through generic kernel interfaces