diff --git a/Makefile b/Makefile
index e5b33cb..d9cc6ce 100644
--- a/Makefile
+++ b/Makefile
@@ -787,7 +787,7 @@
 
 ifeq ($(ARCH), x86)
 FEATURE_CFLAGS += -D'__FLASHROM_HAVE_OUTB__=1'
-PROGRAMMER_OBJS += hwaccess_x86_io.o
+PROGRAMMER_OBJS += hwaccess_x86_io.o  hwaccess_x86_msr.o
 
 ifeq ($(TARGET_OS), NetBSD)
 PCILIBS += -l$(shell uname -p)
diff --git a/board_enable.c b/board_enable.c
index c4d0eb7..2ca08e4 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -28,6 +28,7 @@
 #include "programmer.h"
 #include "hwaccess.h"
 #include "hwaccess_x86_io.h"
+#include "hwaccess_x86_msr.h"
 #include "platform/pci.h"
 
 #if defined(__i386__) || defined(__x86_64__)
diff --git a/chipset_enable.c b/chipset_enable.c
index 1c3d896..44afed7 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -36,6 +36,7 @@
 #include "programmer.h"
 #include "hwaccess.h"
 #include "hwaccess_x86_io.h"
+#include "hwaccess_x86_msr.h"
 #include "platform/pci.h"
 
 #define NOT_DONE_YET 1
diff --git a/hwaccess.h b/hwaccess.h
index 5b7b079..d80e0e3 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -122,35 +122,4 @@
 #define le_to_cpu32 cpu_to_le32
 #define le_to_cpu64 cpu_to_le64
 
-#if NEED_RAW_ACCESS == 1 && (defined (__i386__) || defined (__x86_64__) || defined(__amd64__))
-
-#if !(defined(__MACH__) && defined(__APPLE__)) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__)
-typedef struct { uint32_t hi, lo; } msr_t;
-msr_t rdmsr(int addr);
-int wrmsr(int addr, msr_t msr);
-#endif
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-/* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */
-#undef rdmsr
-#undef wrmsr
-#define rdmsr freebsd_rdmsr
-#define wrmsr freebsd_wrmsr
-typedef struct { uint32_t hi, lo; } msr_t;
-msr_t freebsd_rdmsr(int addr);
-int freebsd_wrmsr(int addr, msr_t msr);
-#endif
-#if defined(__LIBPAYLOAD__)
-#include <arch/io.h>
-#include <arch/msr.h>
-typedef struct { uint32_t hi, lo; } msr_t;
-msr_t libpayload_rdmsr(int addr);
-int libpayload_wrmsr(int addr, msr_t msr);
-#undef rdmsr
-#define rdmsr libpayload_rdmsr
-#define wrmsr libpayload_wrmsr
-#endif
-
-
-#endif
-
 #endif /* !__HWACCESS_H__ */
diff --git a/hwaccess_x86_msr.c b/hwaccess_x86_msr.c
new file mode 100644
index 0000000..79cf2f8
--- /dev/null
+++ b/hwaccess_x86_msr.c
@@ -0,0 +1,355 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2009 Peter Stuge <peter@stuge.se>
+ * Copyright (C) 2009 coresystems GmbH
+ * Copyright (C) 2010 Carl-Daniel Hailfinger
+ * Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/* MSR abstraction implementations for Linux, OpenBSD, FreeBSD/Dragonfly, OSX, libpayload
+ * and a non-working default implementation on the bottom. See also hwaccess.h for some (re)declarations.
+ */
+
+#include "hwaccess_x86_msr.h"
+#include "flash.h"
+
+#ifdef __linux__
+/*
+ * Reading and writing to MSRs, however requires instructions rdmsr/wrmsr,
+ * which are ring0 privileged instructions so only the kernel can do the
+ * read/write. This function, therefore, requires that the msr kernel module
+ * be loaded to access these instructions from user space using device
+ * /dev/cpu/0/msr.
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+static int fd_msr = -1;
+
+msr_t rdmsr(int addr)
+{
+	uint32_t buf[2];
+	msr_t msr = { 0xffffffff, 0xffffffff };
+
+	if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
+		msg_perr("Could not lseek() MSR: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	if (read(fd_msr, buf, 8) == 8) {
+		msr.lo = buf[0];
+		msr.hi = buf[1];
+		return msr;
+	}
+
+	if (errno != EIO) {
+		// A severe error.
+		msg_perr("Could not read() MSR: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	return msr;
+}
+
+int wrmsr(int addr, msr_t msr)
+{
+	uint32_t buf[2];
+	buf[0] = msr.lo;
+	buf[1] = msr.hi;
+
+	if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
+		msg_perr("Could not lseek() MSR: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	if (write(fd_msr, buf, 8) != 8 && errno != EIO) {
+		msg_perr("Could not write() MSR: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	/* Some MSRs must not be written. */
+	if (errno == EIO)
+		return -1;
+
+	return 0;
+}
+
+int setup_cpu_msr(int cpu)
+{
+	char msrfilename[64] = { 0 };
+	snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu/%d/msr", cpu);
+
+	if (fd_msr != -1) {
+		msg_pinfo("MSR was already initialized\n");
+		return -1;
+	}
+
+	fd_msr = open(msrfilename, O_RDWR);
+
+	if (fd_msr < 0) {
+		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
+		msg_pinfo("Did you run 'modprobe msr'?\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+void cleanup_cpu_msr(void)
+{
+	if (fd_msr == -1) {
+		msg_pinfo("No MSR initialized.\n");
+		return;
+	}
+
+	close(fd_msr);
+
+	/* Clear MSR file descriptor. */
+	fd_msr = -1;
+}
+#elif defined(__OpenBSD__) && defined (__i386__) /* This does only work for certain AMD Geode LX systems see amdmsr(4). */
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <machine/amdmsr.h>
+
+static int fd_msr = -1;
+
+msr_t rdmsr(int addr)
+{
+	struct amdmsr_req args;
+
+	msr_t msr = { 0xffffffff, 0xffffffff };
+
+	args.addr = (uint32_t)addr;
+
+	if (ioctl(fd_msr, RDMSR, &args) < 0) {
+		msg_perr("Error while executing RDMSR ioctl: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	msr.lo = args.val & 0xffffffff;
+	msr.hi = args.val >> 32;
+
+	return msr;
+}
+
+int wrmsr(int addr, msr_t msr)
+{
+	struct amdmsr_req args;
+
+	args.addr = addr;
+	args.val = (((uint64_t)msr.hi) << 32) | msr.lo;
+
+	if (ioctl(fd_msr, WRMSR, &args) < 0) {
+		msg_perr("Error while executing WRMSR ioctl: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	return 0;
+}
+
+int setup_cpu_msr(int cpu)
+{
+	char msrfilename[64] = { 0 };
+	snprintf(msrfilename, sizeof(msrfilename), "/dev/amdmsr");
+
+	if (fd_msr != -1) {
+		msg_pinfo("MSR was already initialized\n");
+		return -1;
+	}
+
+	fd_msr = open(msrfilename, O_RDWR);
+
+	if (fd_msr < 0) {
+		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
+		return -1;
+	}
+
+	return 0;
+}
+
+void cleanup_cpu_msr(void)
+{
+	if (fd_msr == -1) {
+		msg_pinfo("No MSR initialized.\n");
+		return;
+	}
+
+	close(fd_msr);
+
+	/* Clear MSR file descriptor. */
+	fd_msr = -1;
+}
+
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+typedef struct {
+	int msr;
+	uint64_t data;
+} cpu_msr_args_t;
+#define CPU_RDMSR _IOWR('c', 1, cpu_msr_args_t)
+#define CPU_WRMSR _IOWR('c', 2, cpu_msr_args_t)
+
+static int fd_msr = -1;
+
+msr_t rdmsr(int addr)
+{
+	cpu_msr_args_t args;
+
+	msr_t msr = { 0xffffffff, 0xffffffff };
+
+	args.msr = addr;
+
+	if (ioctl(fd_msr, CPU_RDMSR, &args) < 0) {
+		msg_perr("Error while executing CPU_RDMSR ioctl: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	msr.lo = args.data & 0xffffffff;
+	msr.hi = args.data >> 32;
+
+	return msr;
+}
+
+int wrmsr(int addr, msr_t msr)
+{
+	cpu_msr_args_t args;
+
+	args.msr = addr;
+	args.data = (((uint64_t)msr.hi) << 32) | msr.lo;
+
+	if (ioctl(fd_msr, CPU_WRMSR, &args) < 0) {
+		msg_perr("Error while executing CPU_WRMSR ioctl: %s\n", strerror(errno));
+		close(fd_msr);
+		exit(1);
+	}
+
+	return 0;
+}
+
+int setup_cpu_msr(int cpu)
+{
+	char msrfilename[64] = { 0 };
+	snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu%d", cpu);
+
+	if (fd_msr != -1) {
+		msg_pinfo("MSR was already initialized\n");
+		return -1;
+	}
+
+	fd_msr = open(msrfilename, O_RDWR);
+
+	if (fd_msr < 0) {
+		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
+		msg_pinfo("Did you install ports/sysutils/devcpu?\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+void cleanup_cpu_msr(void)
+{
+	if (fd_msr == -1) {
+		msg_pinfo("No MSR initialized.\n");
+		return;
+	}
+
+	close(fd_msr);
+
+	/* Clear MSR file descriptor. */
+	fd_msr = -1;
+}
+
+#elif defined(__MACH__) && defined(__APPLE__)
+/* rdmsr() and wrmsr() are provided by DirectHW which needs neither setup nor cleanup. */
+int setup_cpu_msr(int cpu)
+{
+	// Always succeed for now
+	return 0;
+}
+
+void cleanup_cpu_msr(void)
+{
+	// Nothing, yet.
+}
+#elif defined(__LIBPAYLOAD__)
+msr_t libpayload_rdmsr(int addr)
+{
+	msr_t msr;
+	unsigned long long val = _rdmsr(addr);
+	msr.lo = val & 0xffffffff;
+	msr.hi = val >> 32;
+	return msr;
+}
+
+int libpayload_wrmsr(int addr, msr_t msr)
+{
+	_wrmsr(addr, msr.lo | ((unsigned long long)msr.hi << 32));
+	return 0;
+}
+
+int setup_cpu_msr(int cpu)
+{
+	return 0;
+}
+
+void cleanup_cpu_msr(void)
+{
+}
+#else
+/* default MSR implementation */
+msr_t rdmsr(int addr)
+{
+	msr_t ret = { 0xffffffff, 0xffffffff };
+
+	return ret;
+}
+
+int wrmsr(int addr, msr_t msr)
+{
+	return -1;
+}
+
+int setup_cpu_msr(int cpu)
+{
+	msg_pinfo("No MSR support for your OS yet.\n");
+	return -1;
+}
+
+void cleanup_cpu_msr(void)
+{
+	// Nothing, yet.
+}
+#endif // OS switches for MSR code
diff --git a/hwaccess_x86_msr.h b/hwaccess_x86_msr.h
new file mode 100644
index 0000000..4229b3b
--- /dev/null
+++ b/hwaccess_x86_msr.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2009 Carl-Daniel Hailfinger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __HWACCESS_X86_MSR_H__
+#define __HWACCESS_X86_MSR_H__ 1
+
+#include <stdint.h>
+
+#if !(defined(__MACH__) && defined(__APPLE__)) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__)
+typedef struct { uint32_t hi, lo; } msr_t;
+msr_t rdmsr(int addr);
+int wrmsr(int addr, msr_t msr);
+#endif
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+/* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */
+#undef rdmsr
+#undef wrmsr
+#define rdmsr freebsd_rdmsr
+#define wrmsr freebsd_wrmsr
+typedef struct { uint32_t hi, lo; } msr_t;
+msr_t freebsd_rdmsr(int addr);
+int freebsd_wrmsr(int addr, msr_t msr);
+#endif
+
+#if defined(__LIBPAYLOAD__)
+#include <arch/io.h>
+#include <arch/msr.h>
+typedef struct { uint32_t hi, lo; } msr_t;
+msr_t libpayload_rdmsr(int addr);
+int libpayload_wrmsr(int addr, msr_t msr);
+#undef rdmsr
+#define rdmsr libpayload_rdmsr
+#define wrmsr libpayload_wrmsr
+#endif
+
+int setup_cpu_msr(int cpu);
+void cleanup_cpu_msr(void);
+
+#endif /* __HWACCESS_X86_MSR_H__ */
\ No newline at end of file
diff --git a/meson.build b/meson.build
index a731bcf..4db878b 100644
--- a/meson.build
+++ b/meson.build
@@ -332,6 +332,7 @@
 if need_raw_access
   srcs += 'hwaccess.c'
   srcs += 'hwaccess_x86_io.c'
+  srcs += 'hwaccess_x86_msr.c'
   srcs += 'physmap.c'
   cargs += '-DNEED_RAW_ACCESS=1'
   cargs += '-D__FLASHROM_HAVE_OUTB__=1'
diff --git a/physmap.c b/physmap.c
index e2d47d6..d9b1e4f 100644
--- a/physmap.c
+++ b/physmap.c
@@ -362,327 +362,3 @@
 {
 	return physmap_common(descr, phys_addr, len, PHYSM_RO, PHYSM_NOCLEANUP, PHYSM_EXACT);
 }
-
-#if CONFIG_INTERNAL == 1
-/* MSR abstraction implementations for Linux, OpenBSD, FreeBSD/Dragonfly, OSX, libpayload
- * and a non-working default implementation on the bottom. See also hwaccess.h for some (re)declarations. */
-#if defined(__i386__) || defined(__x86_64__)
-
-#ifdef __linux__
-/*
- * Reading and writing to MSRs, however requires instructions rdmsr/wrmsr,
- * which are ring0 privileged instructions so only the kernel can do the
- * read/write. This function, therefore, requires that the msr kernel module
- * be loaded to access these instructions from user space using device
- * /dev/cpu/0/msr.
- */
-
-static int fd_msr = -1;
-
-msr_t rdmsr(int addr)
-{
-	uint32_t buf[2];
-	msr_t msr = { 0xffffffff, 0xffffffff };
-
-	if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
-		msg_perr("Could not lseek() MSR: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	if (read(fd_msr, buf, 8) == 8) {
-		msr.lo = buf[0];
-		msr.hi = buf[1];
-		return msr;
-	}
-
-	if (errno != EIO) {
-		// A severe error.
-		msg_perr("Could not read() MSR: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	return msr;
-}
-
-int wrmsr(int addr, msr_t msr)
-{
-	uint32_t buf[2];
-	buf[0] = msr.lo;
-	buf[1] = msr.hi;
-
-	if (lseek(fd_msr, (off_t) addr, SEEK_SET) == -1) {
-		msg_perr("Could not lseek() MSR: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	if (write(fd_msr, buf, 8) != 8 && errno != EIO) {
-		msg_perr("Could not write() MSR: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	/* Some MSRs must not be written. */
-	if (errno == EIO)
-		return -1;
-
-	return 0;
-}
-
-int setup_cpu_msr(int cpu)
-{
-	char msrfilename[64] = { 0 };
-	snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu/%d/msr", cpu);
-
-	if (fd_msr != -1) {
-		msg_pinfo("MSR was already initialized\n");
-		return -1;
-	}
-
-	fd_msr = open(msrfilename, O_RDWR);
-
-	if (fd_msr < 0) {
-		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
-		msg_pinfo("Did you run 'modprobe msr'?\n");
-		return -1;
-	}
-
-	return 0;
-}
-
-void cleanup_cpu_msr(void)
-{
-	if (fd_msr == -1) {
-		msg_pinfo("No MSR initialized.\n");
-		return;
-	}
-
-	close(fd_msr);
-
-	/* Clear MSR file descriptor. */
-	fd_msr = -1;
-}
-#elif defined(__OpenBSD__) && defined (__i386__) /* This does only work for certain AMD Geode LX systems see amdmsr(4). */
-#include <sys/ioctl.h>
-#include <machine/amdmsr.h>
-
-static int fd_msr = -1;
-
-msr_t rdmsr(int addr)
-{
-	struct amdmsr_req args;
-
-	msr_t msr = { 0xffffffff, 0xffffffff };
-
-	args.addr = (uint32_t)addr;
-
-	if (ioctl(fd_msr, RDMSR, &args) < 0) {
-		msg_perr("Error while executing RDMSR ioctl: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	msr.lo = args.val & 0xffffffff;
-	msr.hi = args.val >> 32;
-
-	return msr;
-}
-
-int wrmsr(int addr, msr_t msr)
-{
-	struct amdmsr_req args;
-
-	args.addr = addr;
-	args.val = (((uint64_t)msr.hi) << 32) | msr.lo;
-
-	if (ioctl(fd_msr, WRMSR, &args) < 0) {
-		msg_perr("Error while executing WRMSR ioctl: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	return 0;
-}
-
-int setup_cpu_msr(int cpu)
-{
-	char msrfilename[64] = { 0 };
-	snprintf(msrfilename, sizeof(msrfilename), "/dev/amdmsr");
-
-	if (fd_msr != -1) {
-		msg_pinfo("MSR was already initialized\n");
-		return -1;
-	}
-
-	fd_msr = open(msrfilename, O_RDWR);
-
-	if (fd_msr < 0) {
-		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
-		return -1;
-	}
-
-	return 0;
-}
-
-void cleanup_cpu_msr(void)
-{
-	if (fd_msr == -1) {
-		msg_pinfo("No MSR initialized.\n");
-		return;
-	}
-
-	close(fd_msr);
-
-	/* Clear MSR file descriptor. */
-	fd_msr = -1;
-}
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-#include <sys/ioctl.h>
-
-typedef struct {
-	int msr;
-	uint64_t data;
-} cpu_msr_args_t;
-#define CPU_RDMSR _IOWR('c', 1, cpu_msr_args_t)
-#define CPU_WRMSR _IOWR('c', 2, cpu_msr_args_t)
-
-static int fd_msr = -1;
-
-msr_t rdmsr(int addr)
-{
-	cpu_msr_args_t args;
-
-	msr_t msr = { 0xffffffff, 0xffffffff };
-
-	args.msr = addr;
-
-	if (ioctl(fd_msr, CPU_RDMSR, &args) < 0) {
-		msg_perr("Error while executing CPU_RDMSR ioctl: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	msr.lo = args.data & 0xffffffff;
-	msr.hi = args.data >> 32;
-
-	return msr;
-}
-
-int wrmsr(int addr, msr_t msr)
-{
-	cpu_msr_args_t args;
-
-	args.msr = addr;
-	args.data = (((uint64_t)msr.hi) << 32) | msr.lo;
-
-	if (ioctl(fd_msr, CPU_WRMSR, &args) < 0) {
-		msg_perr("Error while executing CPU_WRMSR ioctl: %s\n", strerror(errno));
-		close(fd_msr);
-		exit(1);
-	}
-
-	return 0;
-}
-
-int setup_cpu_msr(int cpu)
-{
-	char msrfilename[64] = { 0 };
-	snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu%d", cpu);
-
-	if (fd_msr != -1) {
-		msg_pinfo("MSR was already initialized\n");
-		return -1;
-	}
-
-	fd_msr = open(msrfilename, O_RDWR);
-
-	if (fd_msr < 0) {
-		msg_perr("Error while opening %s: %s\n", msrfilename, strerror(errno));
-		msg_pinfo("Did you install ports/sysutils/devcpu?\n");
-		return -1;
-	}
-
-	return 0;
-}
-
-void cleanup_cpu_msr(void)
-{
-	if (fd_msr == -1) {
-		msg_pinfo("No MSR initialized.\n");
-		return;
-	}
-
-	close(fd_msr);
-
-	/* Clear MSR file descriptor. */
-	fd_msr = -1;
-}
-
-#elif defined(__MACH__) && defined(__APPLE__)
-/* rdmsr() and wrmsr() are provided by DirectHW which needs neither setup nor cleanup. */
-int setup_cpu_msr(int cpu)
-{
-	// Always succeed for now
-	return 0;
-}
-
-void cleanup_cpu_msr(void)
-{
-	// Nothing, yet.
-}
-#elif defined(__LIBPAYLOAD__)
-msr_t libpayload_rdmsr(int addr)
-{
-	msr_t msr;
-	unsigned long long val = _rdmsr(addr);
-	msr.lo = val & 0xffffffff;
-	msr.hi = val >> 32;
-	return msr;
-}
-
-int libpayload_wrmsr(int addr, msr_t msr)
-{
-	_wrmsr(addr, msr.lo | ((unsigned long long)msr.hi << 32));
-	return 0;
-}
-
-int setup_cpu_msr(int cpu)
-{
-	return 0;
-}
-
-void cleanup_cpu_msr(void)
-{
-}
-#else
-/* default MSR implementation */
-msr_t rdmsr(int addr)
-{
-	msr_t ret = { 0xffffffff, 0xffffffff };
-
-	return ret;
-}
-
-int wrmsr(int addr, msr_t msr)
-{
-	return -1;
-}
-
-int setup_cpu_msr(int cpu)
-{
-	msg_pinfo("No MSR support for your OS yet.\n");
-	return -1;
-}
-
-void cleanup_cpu_msr(void)
-{
-	// Nothing, yet.
-}
-#endif // OS switches for MSR code
-#else // x86
-/* Does MSR exist on non-x86 architectures? */
-#endif // arch switches for MSR code
-#endif // CONFIG_INTERNAL == 1
diff --git a/programmer.h b/programmer.h
index 1ab432e..36fdabd 100644
--- a/programmer.h
+++ b/programmer.h
@@ -236,10 +236,8 @@
 void *physmap_ro_unaligned(const char *descr, uintptr_t phys_addr, size_t len);
 void physunmap(void *virt_addr, size_t len);
 void physunmap_unaligned(void *virt_addr, size_t len);
-#if CONFIG_INTERNAL == 1
-int setup_cpu_msr(int cpu);
-void cleanup_cpu_msr(void);
 
+#if CONFIG_INTERNAL == 1
 /* cbtable.c */
 int cb_parse_table(const char **vendor, const char **model);
 int cb_check_image(const uint8_t *bios, unsigned int size);
