added random number generator driver and stuff

This commit is contained in:
Thomas Klaehn
2016-08-30 17:04:22 +02:00
parent b777ab9e6f
commit d7e6f8b0ee
11 changed files with 233 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
/*
* rng.h
*
* Created on: Aug 30, 2016
* Author: tkl
*/
#ifndef SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_RNG_H_
#define SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_RNG_H_
typedef int (*rng_fp_open_t)(const void*);
typedef int (*rng_fp_close_t)(const void*);
typedef unsigned int (*rng_fp_read_t)(const void*);
struct rng_fp {
const rng_fp_open_t open;
const rng_fp_close_t close;
const rng_fp_read_t read;
};
struct rng {
const void *arch_dep_device;
const struct rng_fp *fp;
};
int rng_open(const struct rng *device);
int rng_close(const struct rng *device);
unsigned int rng_read(const struct rng *device);
#endif /* SOURCE_FIRMWARE_KERNEL_DRIVER_INCLUDE_RNG_H_ */