Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34929 )
Change subject: arch/x86: Fix spinlocks for cases of __PRE_RAM__ ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34929/4/src/console/printk.c File src/console/printk.c:
https://review.coreboot.org/c/coreboot/+/34929/4/src/console/printk.c@29 PS4, Line 29: if (ENV_STAGE_HAS_DATA_SECTION) : spin_lock(&console_lock); : else if (ENV_ROMSTAGE && CONFIG(HAVE_ROMSTAGE_CONSOLE_SPINLOCK)) : spin_lock(romstage_console_lock());
Would you rephrase the comment (or was there a question)? […]
I meant you can have a helper function here as well: static spinlock_t *get_console_spinlock(void) {
}
which returns the right spinlock that can be used for calling spin_lock()/spin_unlock() so that you don't have to repeat the same logic twice.
As to whether this should really be supported, if the boards really needing this special logic will be deprecated in the next release, it might make sense to completely drop the ugliness.