util/inteltool: Make internal functions static
None of these functions are used outside of the files they are defined in, so they can all be static. Change-Id: Ie00fef5a5ba2779e0ff45640cff5cc9f1d096dc1 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33945 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
This commit is contained in:
parent
e2e8ccefd7
commit
6faccd1f00
|
@ -78,7 +78,7 @@ inline cpuid_result_t cpuid_ext(int op, unsigned int ecx)
|
||||||
#ifndef __DARWIN__
|
#ifndef __DARWIN__
|
||||||
int msr_readerror = 0;
|
int msr_readerror = 0;
|
||||||
|
|
||||||
msr_t rdmsr(int addr)
|
static msr_t rdmsr(int addr)
|
||||||
{
|
{
|
||||||
uint32_t buf[2];
|
uint32_t buf[2];
|
||||||
msr_t msr = { 0xffffffff, 0xffffffff };
|
msr_t msr = { 0xffffffff, 0xffffffff };
|
||||||
|
@ -132,7 +132,7 @@ static int open_and_seek(int cpu, unsigned long msr, int mode, int *fd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
msr_t rdmsr_from_cpu(int cpu, unsigned long addr)
|
static msr_t rdmsr_from_cpu(int cpu, unsigned long addr)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
msr_t msr = { 0xffffffff, 0xffffffff };
|
msr_t msr = { 0xffffffff, 0xffffffff };
|
||||||
|
@ -155,12 +155,12 @@ msr_t rdmsr_from_cpu(int cpu, unsigned long addr)
|
||||||
return msr;
|
return msr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_number_of_cpus(void)
|
static int get_number_of_cpus(void)
|
||||||
{
|
{
|
||||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_sgx_supported(int cpunum)
|
static int is_sgx_supported(int cpunum)
|
||||||
{
|
{
|
||||||
cpuid_result_t cpuid_regs;
|
cpuid_result_t cpuid_regs;
|
||||||
msr_t msr;
|
msr_t msr;
|
||||||
|
@ -172,14 +172,14 @@ int is_sgx_supported(int cpunum)
|
||||||
return ((cpuid_regs.ebx & SGX_SUPPORTED) && (msr.lo & PRMRR_SUPPORTED));
|
return ((cpuid_regs.ebx & SGX_SUPPORTED) && (msr.lo & PRMRR_SUPPORTED));
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_sgx_enabled(int cpunum)
|
static int is_sgx_enabled(int cpunum)
|
||||||
{
|
{
|
||||||
msr_t data;
|
msr_t data;
|
||||||
data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
|
data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
|
||||||
return (data.lo & SGX_GLOBAL_ENABLED);
|
return (data.lo & SGX_GLOBAL_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_sgx_locked(int cpunum)
|
static int is_sgx_locked(int cpunum)
|
||||||
{
|
{
|
||||||
msr_t data;
|
msr_t data;
|
||||||
data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
|
data = rdmsr_from_cpu(cpunum, IA32_FEATURE_CONTROL);
|
||||||
|
|
|
@ -443,7 +443,7 @@ void unmap_physical(void *virt_addr, size_t len)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void print_version(void)
|
static void print_version(void)
|
||||||
{
|
{
|
||||||
printf("inteltool v%s -- ", INTELTOOL_VERSION);
|
printf("inteltool v%s -- ", INTELTOOL_VERSION);
|
||||||
printf("Copyright (C) 2008 coresystems GmbH\n\n");
|
printf("Copyright (C) 2008 coresystems GmbH\n\n");
|
||||||
|
@ -457,7 +457,7 @@ void print_version(void)
|
||||||
"GNU General Public License for more details.\n\n");
|
"GNU General Public License for more details.\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_usage(const char *name)
|
static void print_usage(const char *name)
|
||||||
{
|
{
|
||||||
printf("usage: %s [-vh?gGrpmedPMaAsfSRx]\n", name);
|
printf("usage: %s [-vh?gGrpmedPMaAsfSRx]\n", name);
|
||||||
printf("\n"
|
printf("\n"
|
||||||
|
|
|
@ -79,7 +79,7 @@ static const io_register_t ich7_spi_bar_registers[] = {
|
||||||
{ 0x68, 4, "PBR2 Protected BIOS Range 2" },
|
{ 0x68, 4, "PBR2 Protected BIOS Range 2" },
|
||||||
};
|
};
|
||||||
|
|
||||||
int print_bioscntl(struct pci_dev *sb)
|
static int print_bioscntl(struct pci_dev *sb)
|
||||||
{
|
{
|
||||||
int i, size = 0;
|
int i, size = 0;
|
||||||
unsigned char bios_cntl = 0xff;
|
unsigned char bios_cntl = 0xff;
|
||||||
|
@ -207,7 +207,7 @@ int print_bioscntl(struct pci_dev *sb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int print_spibar(struct pci_dev *sb) {
|
static int print_spibar(struct pci_dev *sb) {
|
||||||
int i, size = 0, rcba_size = 0x4000;
|
int i, size = 0, rcba_size = 0x4000;
|
||||||
volatile uint8_t *rcba;
|
volatile uint8_t *rcba;
|
||||||
uint32_t rcba_phys;
|
uint32_t rcba_phys;
|
||||||
|
|
Loading…
Reference in New Issue