-
Notifications
You must be signed in to change notification settings - Fork 461
Add freebsd_spi programmer #53
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
Conversation
|
Is there anything holding up this change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks pretty good overall. My only issue is the use of alloca(), and that's easy to fix.
I also went ahead and posted this on the upstream review server: https://review.coreboot.org/c/flashrom/+/30764.
|
|
||
| /* FreeBSD uses a single buffer for rx and tx. Allocate a temporary one to avoid overwriting anything. */ | ||
| size_t tmpcnt = readcnt + writecnt; | ||
| unsigned char *tmpbuf = alloca(tmpcnt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use malloc() instead (see the BUGS section of https://www.freebsd.org/cgi/man.cgi?alloca).
|
@unrelentingtech Hi there. Thank you for your patch! Very cool. Could you rebase this and push it to review.coreboot.org? That would be great! |
|
No, sorry, I'm not interested anymore. |
|
Hi Greg, sorry that this was lost in 2019. Not sure if you received emails from our Gerrit instance. There was some concern about your Signed-off-by. Is "Greg V" your full name? If not, I think either " " or "Greg V" with a complete email address would suffice. This would help us to get the code merged without taking any risk. |
|
Based on linux_spi, using FreeBSD's spigen(4) interface. Change-Id: I4e1689416fbb309df94807f51635bc1f4b53e0c8
|
Thanks! your written permission here is good enough for me. And I'm very sorry about one point of confusion: I didn't realize that |
|
@n-huber will you make the malloc change and merge then? |
|
The patch needs to be rebased first. In the meantime things might have changed a little. And also, we had a discussion about it in IRC. We are thinking if we could add an abstraction layer to minimize the code for freebsd_spi, linux_spi and maybe others. But in general, we want to have this :) |
Based on linux_spi, using FreeBSD's spigen(4) interface