UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
6,694 Views
Registered: ‎05-17-2015

Moving from standalone to xilkernel

Hello,

 

I was looking for some guide or tutorial as to how to use the xil drivers from xilkernel.

It seems that they are more described from standalone.

What I am missing is some guidance as to how these APIs need to be called from xilkernel.

For example, the UART interrupt APIs,

1. Is the API re-entrable ?

2.Is the API thread-safe ?

 

It  seems that such information is very relevant for xilkernel applications.

Are there any examples available ?

 

Thank you,

Ran

 

 

0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
6,683 Views
Registered: ‎08-02-2007

Re: Moving from standalone to xilkernel

hi,

 

a better starting point for looking at xilkernel is to refer example design available at http://www.xilinx.com/support/documentation/sw_manuals/xilinx13_4/ug758.pdf

 

--hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
6,674 Views
Registered: ‎05-17-2015

Re: Moving from standalone to xilkernel

Hi Hem,

 

Thanks for that link. It is important starting point. 

Still, I'm not sure about the issue of thread safety and reentrance of the xilinx HW driver APIs (uart, spi, gpio, i2c, etc.) .

For example, all the XUART APIs and XGPIO APIs, Do you think they can they be called from multtiple threads ?

 

Thank you,

Ran

0 Kudos
Scholar sampatd
Scholar
6,668 Views
Registered: ‎09-05-2011

Re: Moving from standalone to xilkernel

From UG646:

"Xilkernel, by definition, creates a multi-threaded environment. Many library and driver routines
might not be written in a thread-safe or re-entrant manner. Examples include the C library
routines such as printf( ), sprintf( ), malloc( ), free( ). When using any library
or driver API that is not a part of Xilkernel, you must make sure to review thread-safety and reentrancy
features of the routine. One common way to prevent incorrect behavior with unsafe
routines is to protect entry into the routine with locks or semaphores."
0 Kudos
Adventurer
Adventurer
6,655 Views
Registered: ‎05-17-2015

Re: Moving from standalone to xilkernel

Thank you,

I meant in my question Xil-drivers APIs (not malloc) such as:

 

XUartNs550_Recv

XUartNs550_Send

ReceiveDataHandler -> calls also _UserRcvIntHandler

SendDataHandler  -> calls also _UserSendIntHandler

 

XGPIO APIs, and many more...

 

Note that the question of concurrency is relevant not only for OS with thread capability, but also in standalone platform:

If we send/recv at the same time from several ports, we get that these APIs: ReceiveDataHandler , SendDataHandler   can be called in concurrency. It means, as far as I understand, that both of this APIs need to be re-entrent, i.e. if any of the following use globals we can fail: ReceiveDataHandler , _UserRcvIntHandler, SendDataHandler  , _UserSendIntHandler.

 

I'll be happy to have any comments or feedback on this issue.

 

Thanks,

Ran

 

 

 

0 Kudos