/* This function registers and enables the handler specified by ExceptionHandler for a processor interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the handler for the processor interrupt or exception type specified by ExceptionType is uninstalled. The installed handler is called once for each processor interrupt or exception. NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked, otherwise EFI_UNSUPPORTED returned. */
RETURN_STATUS RegisterCpuInterruptHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_CPU_INTERRUPT_HANDLER ExceptionHandler)
/* This function registers and enables the handler specified by ExceptionHandler for a processor interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the handler for the processor interrupt or exception type specified by ExceptionType is uninstalled. The installed handler is called once for each processor interrupt or exception. NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked, otherwise EFI_UNSUPPORTED returned. */
RETURN_STATUS RegisterCpuInterruptHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_CPU_INTERRUPT_HANDLER ExceptionHandler)
{
  if (ExceptionType > gMaxExceptionNumber) {
    return RETURN_UNSUPPORTED;
  }
  if ((ExceptionHandler != NULL) && (gExceptionHandlers[ExceptionType] != NULL)) {
    return RETURN_ALREADY_STARTED;
  }
  gExceptionHandlers[ExceptionType] = ExceptionHandler;
  return RETURN_SUCCESS;
}