> > How would you handle such a case? I guess a machine which can't provide > this runtime service would need some more work in its EFI firmware > before being ready for GRUB, so perhaps this is a moot point. > If no timing is available, you'd need at least return a count of calls to the get_time function. > I propose to re-use the existing function grub_datetime2unixtime() > (which handles correctly the number of days of each month, as well as > leap years), instead of doing the calculations here. And take into > account the time_zone member of grub_efi_time_t as well. get_time is wrong function for getting tsc. You should create a timer event with 10000 units (=1 ms) and in its callback increase millisecond counter. > Also, there is nothing ARM-specific in this function, so I would put it > in a generic EFI file like kern/efi/efi.c. > it is ARM-specific by exclusion. All other EFI ports have TSC and don't need to use EFI functions to retrieve it (other than for calibration on ia64)