summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-01-16 14:03:36 (GMT)
committerBin Meng <bmeng.cn@gmail.com>2017-02-06 03:38:46 (GMT)
commite71ffd0951f4e8dd7c43a34a3fdc4be10f29db41 (patch)
tree16d92632ef2d483804db5b77348b32f335620542 /arch/x86
parent42fd8c19b58fe8f8fe7559ea53b1cef12fc06240 (diff)
downloadu-boot-fsl-qoriq-e71ffd0951f4e8dd7c43a34a3fdc4be10f29db41.tar.xz
x86: Update mpspec to build on 64-bit machines
At present this uses u32 to store an address. We should use unsigned long and avoid special types in function return values and parameters unless necessary. This makes the code more portable. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/mpspec.h8
-rw-r--r--arch/x86/lib/mpspec.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 146a4b0..30dbdca 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -224,9 +224,9 @@ struct mp_ext_compat_address_space {
* @mc: configuration table header address
* @return: configuration table end address
*/
-static inline u32 mp_next_mpc_entry(struct mp_config_table *mc)
+static inline ulong mp_next_mpc_entry(struct mp_config_table *mc)
{
- return (u32)mc + mc->mpc_length;
+ return (ulong)mc + mc->mpc_length;
}
/**
@@ -254,9 +254,9 @@ static inline void mp_add_mpc_entry(struct mp_config_table *mc, uint length)
* @mc: configuration table header address
* @return: configuration table end address
*/
-static inline u32 mp_next_mpe_entry(struct mp_config_table *mc)
+static inline ulong mp_next_mpe_entry(struct mp_config_table *mc)
{
- return (u32)mc + mc->mpc_length + mc->mpe_length;
+ return (ulong)mc + mc->mpc_length + mc->mpe_length;
}
/**
diff --git a/arch/x86/lib/mpspec.c b/arch/x86/lib/mpspec.c
index 516d7b3..17e977c 100644
--- a/arch/x86/lib/mpspec.c
+++ b/arch/x86/lib/mpspec.c
@@ -25,10 +25,10 @@ static bool isa_irq_occupied[16];
struct mp_config_table *mp_write_floating_table(struct mp_floating_table *mf)
{
- u32 mc;
+ ulong mc;
memcpy(mf->mpf_signature, MPF_SIGNATURE, 4);
- mf->mpf_physptr = (u32)mf + sizeof(struct mp_floating_table);
+ mf->mpf_physptr = (ulong)mf + sizeof(struct mp_floating_table);
mf->mpf_length = 1;
mf->mpf_spec = MPSPEC_V14;
mf->mpf_checksum = 0;
@@ -41,7 +41,7 @@ struct mp_config_table *mp_write_floating_table(struct mp_floating_table *mf)
mf->mpf_feature5 = 0;
mf->mpf_checksum = table_compute_checksum(mf, mf->mpf_length * 16);
- mc = (u32)mf + sizeof(struct mp_floating_table);
+ mc = (ulong)mf + sizeof(struct mp_floating_table);
return (struct mp_config_table *)mc;
}
@@ -219,14 +219,14 @@ void mp_write_compat_address_space(struct mp_config_table *mc, int busid,
u32 mptable_finalize(struct mp_config_table *mc)
{
- u32 end;
+ ulong end;
mc->mpe_checksum = table_compute_checksum((void *)mp_next_mpc_entry(mc),
mc->mpe_length);
mc->mpc_checksum = table_compute_checksum(mc, mc->mpc_length);
end = mp_next_mpe_entry(mc);
- debug("Write the MP table at: %x - %x\n", (u32)mc, end);
+ debug("Write the MP table at: %lx - %lx\n", (ulong)mc, end);
return end;
}
@@ -371,7 +371,7 @@ ulong write_mp_table(ulong addr)
int ioapic_id, ioapic_ver;
int bus_isa = 0xff;
int ret;
- u32 end;
+ ulong end;
/* 16 byte align the table address */
addr = ALIGN(addr, 16);