Most of the relevent generic code is in /kernel with the architecture specific code in /arch/*/kernel.