mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
arch/tile: support building big-endian kernel
The toolchain supports big-endian mode now, so add support for building the kernel to run big-endian as well. Signed-off-by: Chris Metcalf <[email protected]>
This commit is contained in:
1 parent
73636b1aac
commit
1efea40d41
10 files changed
+130
-29
No files matched your search
@@ -172,9 +172,6 @@ static tile_bundle_bits rewrite_load_store_unaligned(
|
||||
return (tilepro_bundle_bits) 0;
|
||||
}
|
||||
|
||||
#ifndef __LITTLE_ENDIAN
|
||||
# error We assume little-endian representation with copy_xx_user size 2 here
|
||||
#endif
|
||||
/* Handle unaligned load/store */
|
||||
if (mem_op == MEMOP_LOAD || mem_op == MEMOP_LOAD_POSTINCR) {
|
||||
unsigned short val_16;
|
||||
@@ -195,8 +192,19 @@ static tile_bundle_bits rewrite_load_store_unaligned(
|
||||
state->update = 1;
|
||||
}
|
||||
} else {
|
||||
unsigned short val_16;
|
||||
val = (val_reg == TREG_ZERO) ? 0 : regs->regs[val_reg];
|
||||
err = copy_to_user(addr, &val, size);
|
||||
switch (size) {
|
||||
case 2:
|
||||
val_16 = val;
|
||||
err = copy_to_user(addr, &val_16, sizeof(val_16));
|
||||
break;
|
||||
case 4:
|
||||
err = copy_to_user(addr, &val, sizeof(val));
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
|
||||
Reference in new issue
Block a user