Good day,
I am a student and very interested in flashrom. I fit the description
of experienced C programmer. Open-source and low-level programming are
my interests. I already have real experience with flashrom (CH341A
programmer + chip "MX25L6436E") and want to become a GSoC 2022
contributor in this project.
I find the "Restructure Shutdown Function" project interestring to me.
But right now it has no mentors. Maybe someone from the mailing can
help me.
I have gone through sources and understand how things are now. The
project description says "have a defined shutdown function in the
programmer API". But we already have it. It's programmer_shutdown().
Or no?
The first and easiest thing that comes to my mind is to refuse using
callbacks and use enums, thusly:
enum shutdown_func {
SERPROG = 1 << 0,
SPI = 1 << 1,
...
};
int programmer_shutdown(enum shutdown_func execfunc)
{
...
if(execfunc & SERPROG)
ret |= serprog_shutdown(...);
if(execfunc & SPI) {
/* the problem is that SPI programmers have own shutdown funcs,
like dlc5_shutdown, byteblaster_shutdown, stlinkv3_spi_shutdown,
so use struct spi_master, that contains shutdown callback */
ret |= spi_master_shutdown(...);
}
...
}
This system has disadvantages, but it'll make easier to track the code
flow. What are the potential problems in this implementation?
What's with struct flashrom_programmer? Is not implemented yet?
I would appreciate any feedback.
--
Joursoir
_______________________________________________
flashrom mailing list -- [email protected]
To unsubscribe send an email to [email protected]