mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +02:00
Support rdmsr/wrmsr operations on FreeBSD
So far, AMD Geode LX is the only user of this infrastructure. It needs /dev/cpu0 from ports/sysutils on FreeBSD during runtime on Geode LX. Corresponding to flashrom svn r690. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com> Acked-by: <putlinuxonit@gmail.com>
This commit is contained in:

committed by
Carl-Daniel Hailfinger

parent
dfade10e39
commit
173e3eaabe
12
flash.h
12
flash.h
@ -309,11 +309,21 @@ void *physmap(const char *descr, unsigned long phys_addr, size_t len);
|
||||
void physunmap(void *virt_addr, size_t len);
|
||||
int setup_cpu_msr(int cpu);
|
||||
void cleanup_cpu_msr(void);
|
||||
#ifndef __DARWIN__
|
||||
#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
|
||||
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(__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
|
||||
|
||||
/* internal.c */
|
||||
struct pci_dev *pci_dev_find_filter(struct pci_filter filter);
|
||||
|
Reference in New Issue
Block a user