Skip to content

Commit

Permalink
Add syscall for os_factory_hash()
Browse files Browse the repository at this point in the history
  • Loading branch information
yrichard-ledger committed Sep 21, 2023
1 parent 94e058e commit a55b0d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/os_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ SYSCALL unsigned int os_flags(void);
SYSCALL unsigned int os_version(unsigned char *version PLENGTH(maxlength), unsigned int maxlength);
/* Grab the SE serial number */
SYSCALL unsigned int os_serial(unsigned char *serial PLENGTH(maxlength), unsigned int maxlength);
/* 32-bytes data unique to SE */
SYSCALL unsigned int os_factory_hash(unsigned char *buffer PLENGTH(maxlength),
unsigned int maxlength);

#ifdef HAVE_MCU_SERIAL_STORAGE
/* Grab the SEPROXYHAL's MCU serial number */
SYSCALL unsigned int os_seph_serial(unsigned char *serial PLENGTH(maxlength),
unsigned int maxlength);
#endif // HAVE_MCU_SERIAL_STORAGE
/* Grab the SEPROXYHAL's feature set */

/* Grab the SEPROXYHAL's feature set */
SYSCALL unsigned int os_seph_features(void);
/* Grab the SEPROXYHAL's version */
SYSCALL unsigned int os_seph_version(unsigned char *version PLENGTH(maxlength),
Expand Down
1 change: 1 addition & 0 deletions include/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
#define SYSCALL_os_flags_ID 0x0000006a
#define SYSCALL_os_version_ID 0x0200006b
#define SYSCALL_os_serial_ID 0x0200006c
#define SYSCALL_os_factory_hash_ID 0x02000075
#define SYSCALL_os_seph_features_ID 0x0000006e
#define SYSCALL_os_seph_version_ID 0x0200006f
#define SYSCALL_os_bootloader_version_ID 0x02000073
Expand Down
8 changes: 8 additions & 0 deletions src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,14 @@ unsigned int os_serial(unsigned char *serial, unsigned int maxlength)
return (unsigned int) SVC_Call(SYSCALL_os_serial_ID, parameters);
}

unsigned int os_factory_hash(unsigned char *buffer, unsigned int maxlength)
{
unsigned int parameters[2];
parameters[0] = (unsigned int) buffer;
parameters[1] = (unsigned int) maxlength;
return (unsigned int) SVC_Call(SYSCALL_os_factory_hash_ID, parameters);
}

unsigned int os_seph_features(void)
{
unsigned int parameters[2];
Expand Down

0 comments on commit a55b0d9

Please sign in to comment.