You should probably look at function RCC_GetClocksFreq from file stm32fXXX_rcc.c