What to be perfomed in up_earlyserialinit?

2021-02-10 Thread Sara da Cunha Monteiro de Souza
Hi all, I've been working in the serial driver. And I've got a little confused about what is to be performed in *up_earlyserialinit. * I've been looking at other chips and I noticed that the *_lowsetup *function performs almost the same of this function and the latter is called earlier than the fo

Re: What to be perfomed in up_earlyserialinit?

2021-02-10 Thread Gregory Nutt
The primary purpose of xyz_earlyserialinit() is to make the serial console available for low level debug output before the serial driver is initialized. That happens much later.  That is helpful mostly for debugging. Without early initialization of the serial console, there will be no output un

Re: What to be perfomed in up_earlyserialinit?

2021-02-10 Thread Gregory Nutt
As I said, the early serial initialization is needed for boot-up debug output.  Here is a little more detail: If the serial is not initialized, then up_putc will not work.  In fact, any calls to up_putc() could hang.  If the serial console is the syslog debug channel, then up_putc is called fr

strdup & free in protected build

2021-02-10 Thread Jukka Laitinen
Hi, I think that there is the following weirdness in strdup; The function is made to allocate memory from kernel or user-space heap according to where it is used, via lib_malloc. But, there is no similar transparent way to free the memory. Normally, when using strdup, you'd simply use "free"

RE: strdup & free in protected build

2021-02-10 Thread spudaneco
You could use lib_free()Sent from my Galaxy