Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syscall for os_factory_hash() #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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