While compiling OTGv1 driver for STM32F105 I found the following:
compiling usb_lld.c...
os\hal\ports\STM32\LLD\OTGv1\usb_lld.c(502): warning: #223-D: function "CORTEX_PRIORITY_MASK" declared implicitly
__set_BASEPRI(CORTEX_PRIORITY_MASK(STM32_USB_OTGFIFO_FILL_BASEPRI));
os\hal\ports\STM32\LLD\OTGv1\usb_lld.c: 1 warning, 0 errors
linking...
.\out\k-line.axf: Error: L6218E: Undefined symbol CORTEX_PRIORITY_MASK (referred from usb_lld.o).
Searching across the code I saw that CORTEX_PRIORITY_MASK macro is not defined (it was in ChibiOS 2), but now its name is CORTEX_PRIO_MASK (chcore.h)
Patch included.