Creating a new hardware abstraction layer

Hello everyone

For our term project me and my friends are trying to design a hardware abstraction layer for a board using the AT32UC3C0512 microprocessor. Frankly the code looks very complex and hard to reverse engineer and we couldn’t find many guides that explain the code with great detail. So what we are trying to do is looking at the AP_HAL_AVR library and trying to mimic the contents for our microprocessor. There have been some confusing points for us:

Some of the libraries are included but not present in the code, for example we couldn’t find <avr/interrupt.h> library inside gpio.cpp. Are these included with some sort of an IDE?
I understand how some variables that represent the registers (e.g. SREG, EICRB etc.) are used but I could not find the exact location that they are defined. I mean where in the code is the variable named SREG is actually assigned to the SREG register of the microprocessor?
I have seen that the new_sample() method inside AnalogIn_ADC.cpp is called with an interrupt. But I have failed to locate the actual interrupt that calls this function. When does this interrupt happen (when the value read in ADC reaches a certain point?) and how does this interrupt call the new_sample() function?
Would you recommend using the ASF drivers provided with the Atmel Studio?

I have already posted these questions on diydrones but I believe this a better place to discuss such topics.

Thanks in advance for your help