x86: move patching code to arch-specific file.