1
0
Fork 0
forked from nuttx/nuttx-update

syscall/: Implementation of sysclal for new getitimer and setitimer were incomplete.

This commit is contained in:
Gregory Nutt 2019-11-14 09:48:56 -06:00
parent 82a4111a2b
commit 741fa461c1
3 changed files with 119 additions and 0 deletions

View file

@ -40,6 +40,9 @@
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <sys/socket.h>
#include <stdint.h>
@ -351,11 +354,14 @@
#define CRYPTO_MSG_DELALG 2
#define CRYPTO_MSG_UPDATEALG 3
#define CRYPTO_MSG_GETALG 4
#define CRYPTO_MSG_DELRNG 5
#define CRYPTO_MSG_GETSTAT 6
/* Netlink message attributes. */
#define CRYPTOCFGA_UNSPEC 0
#define CRYPTOCFGA_PRIORITY_VAL 1 /* Argument: uint32_t */
#define CRYPTOCFGA_REPORT_LARVAL 2 /* Argument: struct crypto_report_larval */
#define CRYPTOCFGA_REPORT_HASH 3 /* Argument: struct crypto_report_hash */
#define CRYPTOCFGA_REPORT_BLKCIPHER 4 /* Argument: struct crypto_report_blkcipher */
@ -363,6 +369,20 @@
#define CRYPTOCFGA_REPORT_COMPRESS 6 /* Argument: struct crypto_report_comp */
#define CRYPTOCFGA_REPORT_RNG 7 /* Argument: struct crypto_report_rng */
#define CRYPTOCFGA_REPORT_CIPHER 8 /* Argument: struct crypto_report_cipher */
#define CRYPTOCFGA_REPORT_AKCIPHER 9 /* Argument: struct crypto_report_akcipher */
#define CRYPTOCFGA_REPORT_KPP 0 /* Argument: struct crypto_report_kpp */
#define CRYPTOCFGA_REPORT_ACOMP 1 /* Argument: struct crypto_report_acomp */
#define CRYPTOCFGA_STAT_LARVAL 2 /* Argument: struct crypto_stat_larval */
#define CRYPTOCFGA_STAT_HASH 3 /* Argument: struct crypto_stat_hash */
#define CRYPTOCFGA_STAT_BLKCIPHER 4 /* Argument: struct crypto_stat_blkcipher */
#define CRYPTOCFGA_STAT_AEAD 5 /* Argument: struct crypto_stat_aead */
#define CRYPTOCFGA_STAT_COMPRESS 6 /* Argument: struct crypto_stat_comp */
#define CRYPTOCFGA_STAT_RNG 7 /* Argument: struct crypto_stat_rng */
#define CRYPTOCFGA_STAT_CIPHER 8 /* Argument: struct crypto_stat_cipher */
#define CRYPTOCFGA_STAT_AKCIPHER 9 /* Argument: struct crypto_stat_akcipher */
#define CRYPTOCFGA_STAT_KPP 10 /* Argument: struct crypto_stat_kpp */
#define CRYPTOCFGA_STAT_ACOMP 11 /* Argument: struct crypto_stat_acomp */
/* Max size of names. No magic here. These can be extended as necessary. */
@ -549,6 +569,100 @@ struct crypto_report_rng
size_t seedsize;
};
struct crypto_report_akcipher
{
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_kpp
{
char type[CRYPTO_MAX_NAME];
};
struct crypto_report_acomp
{
char type[CRYPTO_MAX_NAME];
};
struct crypto_stat_larval
{
char type[CRYPTO_MAX_NAME];
};
#ifdef CONFIG_HAVE_LONG_LONG
typedef uint64_t crypto_stat_t;
#else
typedef uint32_t crypto_stat_t;
#endif
struct crypto_stat_aead
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_encrypt_cnt;
crypto_stat_t stat_encrypt_tlen;
crypto_stat_t stat_decrypt_cnt;
crypto_stat_t stat_decrypt_tlen;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_akcipher
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_encrypt_cnt;
crypto_stat_t stat_encrypt_tlen;
crypto_stat_t stat_decrypt_cnt;
crypto_stat_t stat_decrypt_tlen;
crypto_stat_t stat_verify_cnt;
crypto_stat_t stat_sign_cnt;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_cipher
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_encrypt_cnt;
crypto_stat_t stat_encrypt_tlen;
crypto_stat_t stat_decrypt_cnt;
crypto_stat_t stat_decrypt_tlen;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_compress
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_compress_cnt;
crypto_stat_t stat_compress_tlen;
crypto_stat_t stat_decompress_cnt;
crypto_stat_t stat_decompress_tlen;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_hash
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_hash_cnt;
crypto_stat_t stat_hash_tlen;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_kpp
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_setsecret_cnt;
crypto_stat_t stat_generate_public_key_cnt;
crypto_stat_t stat_compute_shared_secret_cnt;
crypto_stat_t stat_err_cnt;
};
struct crypto_stat_rng
{
char type[CRYPTO_MAX_NAME];
crypto_stat_t stat_generate_cnt;
crypto_stat_t stat_generate_tlen;
crypto_stat_t stat_seed_cnt;
crypto_stat_t stat_err_cnt;
};
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View file

@ -178,6 +178,8 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)
SYSCALL_LOOKUP(getitimer, 2, STUB_getitimer)
SYSCALL_LOOKUP(setitimer, 3, STUB_setitimer)
#ifdef CONFIG_CLOCK_TIMEKEEPING
SYSCALL_LOOKUP(adjtime, 2, STUB_adjtime)
#endif

View file

@ -173,6 +173,9 @@ uintptr_t STUB_clock(int nbr);
uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_clock_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_clock_settime(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_getitimer(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_setitimer(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_adjtime(int nbr, uintptr_t parm1, uintptr_t parm2);
/* The following are defined only if POSIX timers are supported */