AnsweredAssumed Answered

Secure Function Arguments

Question asked by ydfang on Apr 5, 2011
Latest reply on Apr 5, 2011 by WassimB

In the Hardware document, (16-35) , it shows that:

 

Secure Function Arguments
When the message is successfully authenticated, the program counter will
vector to the Secure Function with the first argument (R0) containing a
pointer to the top of the L1B data memory. The second argument (R1) of
the secure function is the IMASK value. This value is obtained when the
SESR successfully authenticates the message. Before the message is trans-
ferred via DMA to its final target run location, interrupts are shut off so
tampering cannot occur between the time of successful authentication and
execution of the secure function. The prototype for the secure function is:
void secure_function(tSecureFunctionArgs *, unsigned short
imask);

 

I have two questions here.

1) What's the type of  tSecureFunctionArgs?

 

2)When I change the Lockbox examples secure_function function to this,

secure_function(void * tSecureFunctionArgs, unsigned short imask);

 

It crashes after print the log . (__unknow_exception_occurred)

 

Here is the code. (The code based on the WassiMB's posting on modify ldf file to exit the calling function)

 

 

section("overlay_live_1") void secure_function(void * tSecureFunctionArgs, unsigned short imask)
{
  /* Enable JTAG */
  *pSECURE_SYSSWT = ( *pSECURE_SYSSWT & ENABLE_JTAG_MASK );
  //*pSECURE_SYSSWT = imask;
  ssync();
 
  log_authentication_results();
/*
  char * cTemp = (char *) tSecureFunctionArgs;
  int i;
  for (i =0;i< 24;i++)
      printf ("%3d ",  cTemp[i]);
*/
//            led_blink();
//            printf ("imask = %5d ",  imask);
//            printf ("tSecureFunctionArgs = %0x7d ",  tSecureFunctionArgs);

 

return;

}

Outcomes