ia64/xen-unstable

changeset 18768:7ef733b961c8

[IA64] Remove the useless big endian stuff.

This patch removes all the useless big endian stuff from the mini-os.
Before there was an effort to support big endian for PV-guest.
But the big endian support was never gotten into the common parts of
the mini-os so it makes no sense to have this only in the ia64
specific sources. And as there is no open source big endian os and
porting our BS2000 os to ia64 was stopped, nobody wants that stuff
in the common minos.
So this looks ugly then and remove the big endian stuff.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
author dietmar.hahn@fujitsu-siemens.com
date Tue Nov 18 10:55:51 2008 +0100 (2008-11-18)
parents cf3b9afb8568
children 436816898c87
files extras/mini-os/arch/ia64/arch.mk extras/mini-os/arch/ia64/common.c extras/mini-os/arch/ia64/debug.c extras/mini-os/arch/ia64/efi.c extras/mini-os/arch/ia64/fw.S extras/mini-os/arch/ia64/ia64.S extras/mini-os/arch/ia64/ivt.S extras/mini-os/arch/ia64/mm.c extras/mini-os/arch/ia64/sal.c extras/mini-os/arch/ia64/time.c extras/mini-os/arch/ia64/xencomm.c extras/mini-os/include/ia64/atomic.h extras/mini-os/include/ia64/endian.h extras/mini-os/include/ia64/ia64_cpu.h extras/mini-os/include/ia64/os.h
line diff
     1.1 --- a/extras/mini-os/arch/ia64/arch.mk	Mon Nov 17 09:27:02 2008 +0100
     1.2 +++ b/extras/mini-os/arch/ia64/arch.mk	Tue Nov 18 10:55:51 2008 +0100
     1.3 @@ -1,5 +1,3 @@
     1.4 -# Build for Big Endian?
     1.5 -BIGENDIAN ?= n
     1.6  
     1.7  ARCH_CFLAGS := -mfixed-range=f2-f5,f12-f15,f32-f127 -mconstant-gp
     1.8  ARCH_CFLAGS += -O2
     1.9 @@ -9,12 +7,3 @@ ARCH_ASFLAGS += -fno-builtin -fno-common
    1.10  
    1.11  ARCH_LDFLAGS = -warn-common
    1.12  
    1.13 -# Next lines are for big endian code !
    1.14 -ifeq ($(BIGENDIAN),y)
    1.15 -ARCH_CFLAGS += -mbig-endian -Wa,-mbe -Wa,-mlp64
    1.16 -ARCH_CFLAGS += -DBIG_ENDIAN
    1.17 -ARCH_ASFLAGS += -Wa,-mbe
    1.18 -ARCH_ASFLAGS += -DBIG_ENDIAN
    1.19 -ARCH_LDFLAGS = -EB -d
    1.20 -endif
    1.21 -
     2.1 --- a/extras/mini-os/arch/ia64/common.c	Mon Nov 17 09:27:02 2008 +0100
     2.2 +++ b/extras/mini-os/arch/ia64/common.c	Tue Nov 18 10:55:51 2008 +0100
     2.3 @@ -116,8 +116,8 @@ registerCallback(void)
     2.4  {
     2.5  	struct callback_register event =
     2.6  	{
     2.7 -		.type = SWAP(CALLBACKTYPE_event),
     2.8 -		.address = SWAP((unsigned long)&hypervisor_callback),
     2.9 +		.type = CALLBACKTYPE_event,
    2.10 +		.address = (unsigned long)&hypervisor_callback,
    2.11  	};
    2.12  	HYPERVISOR_callback_op(CALLBACKOP_register, &event);
    2.13  }
    2.14 @@ -126,46 +126,44 @@ static void
    2.15  init_start_info(start_info_t* xen_start_info)
    2.16  {
    2.17  	/* Make a copy of the start_info structure */
    2.18 -	start_info.nr_pages = SWAP(xen_start_info->nr_pages);
    2.19 -	start_info.shared_info = SWAP(xen_start_info->shared_info);
    2.20 -	start_info.flags = SWAP(xen_start_info->flags);
    2.21 -	start_info.store_mfn = SWAP(xen_start_info->store_mfn);
    2.22 -	start_info.store_evtchn	= SWAP(xen_start_info->store_evtchn);
    2.23 -	start_info.console.domU.mfn = SWAP(xen_start_info->console.domU.mfn);
    2.24 +	start_info.nr_pages = xen_start_info->nr_pages;
    2.25 +	start_info.shared_info = xen_start_info->shared_info;
    2.26 +	start_info.flags = xen_start_info->flags;
    2.27 +	start_info.store_mfn = xen_start_info->store_mfn;
    2.28 +	start_info.store_evtchn	= xen_start_info->store_evtchn;
    2.29 +	start_info.console.domU.mfn = xen_start_info->console.domU.mfn;
    2.30  	start_info.console.domU.evtchn =
    2.31 -				SWAP(xen_start_info->console.domU.evtchn);
    2.32 -	start_info.pt_base = SWAP(xen_start_info->pt_base);
    2.33 -	start_info.nr_pt_frames	= SWAP(xen_start_info->nr_pt_frames);
    2.34 -	start_info.mfn_list = SWAP(xen_start_info->mfn_list);
    2.35 -	start_info.mod_start = SWAP(xen_start_info->mod_start);
    2.36 -	start_info.mod_len = SWAP(xen_start_info->mod_len);
    2.37 +				xen_start_info->console.domU.evtchn;
    2.38 +	start_info.pt_base = xen_start_info->pt_base;
    2.39 +	start_info.nr_pt_frames	= xen_start_info->nr_pt_frames;
    2.40 +	start_info.mfn_list = xen_start_info->mfn_list;
    2.41 +	start_info.mod_start = xen_start_info->mod_start;
    2.42 +	start_info.mod_len = xen_start_info->mod_len;
    2.43  }
    2.44  
    2.45  static void
    2.46  init_boot_params(void)
    2.47  {
    2.48 -	ia64BootParamG.command_line = SWAP(ia64_boot_paramP->command_line);
    2.49 -	ia64BootParamG.efi_systab = SWAP(ia64_boot_paramP->efi_systab);
    2.50 -	ia64BootParamG.efi_memmap = SWAP(ia64_boot_paramP->efi_memmap);
    2.51 -	ia64BootParamG.efi_memmap_size =
    2.52 -				SWAP(ia64_boot_paramP->efi_memmap_size);
    2.53 -	ia64BootParamG.efi_memdesc_size	=
    2.54 -				SWAP(ia64_boot_paramP->efi_memdesc_size);
    2.55 +	ia64BootParamG.command_line = ia64_boot_paramP->command_line;
    2.56 +	ia64BootParamG.efi_systab = ia64_boot_paramP->efi_systab;
    2.57 +	ia64BootParamG.efi_memmap = ia64_boot_paramP->efi_memmap;
    2.58 +	ia64BootParamG.efi_memmap_size = ia64_boot_paramP->efi_memmap_size;
    2.59 +	ia64BootParamG.efi_memdesc_size	= ia64_boot_paramP->efi_memdesc_size;
    2.60  	ia64BootParamG.efi_memdesc_version =
    2.61 -				SWAP(ia64_boot_paramP->efi_memdesc_version);
    2.62 +				ia64_boot_paramP->efi_memdesc_version;
    2.63  	ia64BootParamG.console_info.num_cols =
    2.64 -				SWAP(ia64_boot_paramP->console_info.num_cols);
    2.65 +				ia64_boot_paramP->console_info.num_cols;
    2.66  	ia64BootParamG.console_info.num_rows =
    2.67 -				SWAP(ia64_boot_paramP->console_info.num_rows);
    2.68 +				ia64_boot_paramP->console_info.num_rows;
    2.69  	ia64BootParamG.console_info.orig_x =
    2.70 -				SWAP(ia64_boot_paramP->console_info.orig_x);
    2.71 +				ia64_boot_paramP->console_info.orig_x;
    2.72  	ia64BootParamG.console_info.orig_y =
    2.73 -				SWAP(ia64_boot_paramP->console_info.orig_y);
    2.74 -	ia64BootParamG.fpswa = SWAP(ia64_boot_paramP->fpswa);
    2.75 -	ia64BootParamG.initrd_start = SWAP(ia64_boot_paramP->initrd_start);
    2.76 -	ia64BootParamG.initrd_size = SWAP(ia64_boot_paramP->initrd_size);
    2.77 -	ia64BootParamG.domain_start = SWAP(ia64_boot_paramP->domain_start);
    2.78 -	ia64BootParamG.domain_size = SWAP(ia64_boot_paramP->domain_size);
    2.79 +				ia64_boot_paramP->console_info.orig_y;
    2.80 +	ia64BootParamG.fpswa = ia64_boot_paramP->fpswa;
    2.81 +	ia64BootParamG.initrd_start = ia64_boot_paramP->initrd_start;
    2.82 +	ia64BootParamG.initrd_size = ia64_boot_paramP->initrd_size;
    2.83 +	ia64BootParamG.domain_start = ia64_boot_paramP->domain_start;
    2.84 +	ia64BootParamG.domain_size = ia64_boot_paramP->domain_size;
    2.85  
    2.86  	/*
    2.87  	 * Copy and parse the boot command line.
     3.1 --- a/extras/mini-os/arch/ia64/debug.c	Mon Nov 17 09:27:02 2008 +0100
     3.2 +++ b/extras/mini-os/arch/ia64/debug.c	Tue Nov 18 10:55:51 2008 +0100
     3.3 @@ -102,7 +102,6 @@ static const char *ia64_vector_names[] =
     3.4  
     3.5  typedef struct
     3.6  {
     3.7 -#if !defined(BIG_ENDIAN)
     3.8  	uint64_t sof	:7;	/* 0-6 size of frame */
     3.9  	uint64_t sol	:7;	/* 7-13 size of locals (in + loc) */
    3.10  	uint64_t sor	:4;
    3.11 @@ -111,16 +110,6 @@ typedef struct
    3.12  	uint64_t rrb_pr	:6;
    3.13  	uint64_t res	:25;	/* reserved */
    3.14  	uint64_t v	:1;	/* The v bit */
    3.15 -#else /* !BIG_ENDIAN */
    3.16 -	uint64_t v	:1;	/* The v bit */
    3.17 -	uint64_t res	:25;	/* reserved */
    3.18 -	uint64_t rrb_pr	:6;
    3.19 -	uint64_t rrb_fr	:7;
    3.20 -	uint64_t rrb_gr	:7;
    3.21 -	uint64_t sor	:4;
    3.22 -	uint64_t sol	:7;	/* 7-13 size of locals (in + loc) */
    3.23 -	uint64_t sof	:7;	/* 0-6 size of frame */
    3.24 -#endif /* BIG_ENDIAN */
    3.25  } ifs_t;
    3.26  
    3.27  void
     4.1 --- a/extras/mini-os/arch/ia64/efi.c	Mon Nov 17 09:27:02 2008 +0100
     4.2 +++ b/extras/mini-os/arch/ia64/efi.c	Tue Nov 18 10:55:51 2008 +0100
     4.3 @@ -49,13 +49,6 @@ efi_get_time(efi_time_t* tmP)
     4.4  		printk("efi.getTime() failed\n");
     4.5  		return 0;
     4.6  	}
     4.7 -
     4.8 -#if defined(BIG_ENDIAN)
     4.9 -	tmP->Year = SWAP(tmP->Year);
    4.10 -	tmP->TimeZone = SWAP(tmP->TimeZone);
    4.11 -	tmP->Nanosecond = SWAP(tmP->Nanosecond);
    4.12 -#endif
    4.13 -
    4.14  	return 1;
    4.15  }
    4.16  
    4.17 @@ -65,17 +58,7 @@ efi_get_time(efi_time_t* tmP)
    4.18  static int
    4.19  efi_guid_cmp(efi_guid_t* a_le, efi_guid_t* b)
    4.20  {
    4.21 -#if defined(BIG_ENDIAN)
    4.22 -	if(SWAP(a_le->Data1) != b->Data1)
    4.23 -		return 1;
    4.24 -	if(SWAP(a_le->Data2) != b->Data2)
    4.25 -		return 1;
    4.26 -	if(SWAP(a_le->Data3) != b->Data3)
    4.27 -		return 1;
    4.28 -	return memcmp(a_le->Data4, b->Data4, sizeof(uint8_t)*8);
    4.29 -#else
    4.30  	return memcmp(a_le, b, sizeof(efi_guid_t));
    4.31 -#endif
    4.32  }
    4.33  
    4.34  void
    4.35 @@ -99,20 +82,20 @@ init_efi(void)
    4.36  	efiSysTableP = (efi_system_table_t*)__va(ia64BootParamG.efi_systab);
    4.37  	machineFwG.efi.efiSysTableP = efiSysTableP;
    4.38  	PRINT_BV("EfiSystemTable at: %p\n", efiSysTableP);
    4.39 -	fwP = (uint16_t*) __va(SWAP(efiSysTableP->FirmwareVendor));
    4.40 +	fwP = (uint16_t*) __va(efiSysTableP->FirmwareVendor);
    4.41  	if (fwP) {
    4.42  		for (i = 0; i < (int)sizeof(fwVendor) - 1 && *fwP; ++i)
    4.43 -			fwVendor[i] = SWAP(*fwP++);
    4.44 +			fwVendor[i] = *fwP++;
    4.45  		fwVendor[i] = '\0';
    4.46  	}
    4.47  	PRINT_BV("  EFI-FirmwareVendor        : %s\n", fwVendor);
    4.48  	PRINT_BV("  EFI-FirmwareRevision      : %d\n",
    4.49 -		 SWAP(efiSysTableP->FirmwareRevision));
    4.50 +		 efiSysTableP->FirmwareRevision);
    4.51  	PRINT_BV("  EFI-SystemTable-Revision  : %d.%d\n",
    4.52 -		 SWAP(efiSysTableP->Hdr.Revision)>>16,
    4.53 -		 SWAP(efiSysTableP->Hdr.Revision)&0xffff);
    4.54 +		 efiSysTableP->Hdr.Revision >> 16,
    4.55 +		 efiSysTableP->Hdr.Revision & 0xffff);
    4.56  	rsP = (efi_runtime_services_t*)
    4.57 -		__va(SWAP(efiSysTableP->RuntimeServices));
    4.58 +		__va(efiSysTableP->RuntimeServices);
    4.59  	mdcnt = ia64BootParamG.efi_memmap_size /
    4.60  		ia64BootParamG.efi_memdesc_size;
    4.61  	memdP = (efi_memory_descriptor_t*) __va(ia64BootParamG.efi_memmap);
    4.62 @@ -123,10 +106,10 @@ init_efi(void)
    4.63  	     mdP = NextMemoryDescriptor(mdP, ia64BootParamG.efi_memdesc_size)) {
    4.64  		/* Relocate runtime memory segments for firmware. */
    4.65  		PRINT_BV("  %d. Type: %x  Attributes: 0x%lx\n",
    4.66 -			 i, SWAP(mdP->Type), SWAP(mdP->Attribute));
    4.67 +			 i, mdP->Type, mdP->Attribute);
    4.68  		PRINT_BV("     PhysStart: 0x%lx  NumPages: 0x%lx\n",
    4.69 -			 SWAP(mdP->PhysicalStart), SWAP(mdP->NumberOfPages));
    4.70 -		switch (SWAP(mdP->Type)) {
    4.71 +			 mdP->PhysicalStart, mdP->NumberOfPages);
    4.72 +		switch (mdP->Type) {
    4.73  			case EfiRuntimeServicesData:
    4.74  				PRINT_BV("     -> EfiRuntimeServicesData\n");
    4.75  				break;
    4.76 @@ -139,18 +122,17 @@ init_efi(void)
    4.77  			case EfiConventionalMemory:
    4.78  				PRINT_BV("     -> EfiConventionalMemory\n");
    4.79  				PRINT_BV("        start: 0x%lx end: 0x%lx\n",
    4.80 -					SWAP(mdP->PhysicalStart),
    4.81 -					SWAP(mdP->PhysicalStart)+
    4.82 -					SWAP(mdP->NumberOfPages)*EFI_PAGE_SIZE);
    4.83 +					mdP->PhysicalStart,
    4.84 +					mdP->PhysicalStart +
    4.85 +					mdP->NumberOfPages * EFI_PAGE_SIZE);
    4.86  				if (numConvMem) {
    4.87  					printk("     Currently only one efi "
    4.88  						"memory chunk supported !!!\n");
    4.89  					break;
    4.90  				}
    4.91 -				machineFwG.mach_mem_start =
    4.92 -					SWAP(mdP->PhysicalStart);
    4.93 +				machineFwG.mach_mem_start = mdP->PhysicalStart;
    4.94  				machineFwG.mach_mem_size =
    4.95 -					SWAP(mdP->NumberOfPages)*EFI_PAGE_SIZE;
    4.96 +					mdP->NumberOfPages * EFI_PAGE_SIZE;
    4.97  				numConvMem++;
    4.98  				break;
    4.99  			case EfiMemoryMappedIOPortSpace:
   4.100 @@ -158,7 +140,7 @@ init_efi(void)
   4.101  				break;
   4.102  			case EfiPalCode:
   4.103                         		machineFwG.ia64_pal_base =
   4.104 -					__va(SWAP(mdP->PhysicalStart));
   4.105 +					__va(mdP->PhysicalStart);
   4.106  				PRINT_BV("     -> EfiPalCode\n"
   4.107  					 "        start : %p\n",
   4.108  					 machineFwG.ia64_pal_base);
   4.109 @@ -170,12 +152,11 @@ init_efi(void)
   4.110  		 * virtual addressing and the efi runtime functions
   4.111  		 * may be called directly.
   4.112  		 */
   4.113 -		if (SWAP(mdP->Attribute) & EFI_MEMORY_RUNTIME) {
   4.114 -			if (SWAP(mdP->Attribute) & EFI_MEMORY_WB)
   4.115 -				mdP->VirtualStart =
   4.116 -					SWAP(__va(mdP->PhysicalStart));
   4.117 +		if (mdP->Attribute & EFI_MEMORY_RUNTIME) {
   4.118 +			if (mdP->Attribute & EFI_MEMORY_WB)
   4.119 +				mdP->VirtualStart = __va(mdP->PhysicalStart);
   4.120  			else {
   4.121 -				if (SWAP(mdP->Attribute) & EFI_MEMORY_UC)
   4.122 +				if (mdP->Attribute & EFI_MEMORY_UC)
   4.123  					printk("efi_init: RuntimeMemory with "
   4.124  						"UC attribute !!!!!!\n");
   4.125  					/*
   4.126 @@ -187,7 +168,7 @@ init_efi(void)
   4.127  	}
   4.128  	/* Now switch efi runtime stuff to virtual addressing. */
   4.129  	status = ia64_call_efi_physical(
   4.130 -			(void*)__va(SWAP((uint64_t)rsP->SetVirtualAddressMap)),
   4.131 +			(void*)__va((uint64_t)rsP->SetVirtualAddressMap),
   4.132  			ia64BootParamG.efi_memmap_size,
   4.133  			ia64BootParamG.efi_memdesc_size,
   4.134  			ia64BootParamG.efi_memdesc_version,
   4.135 @@ -200,35 +181,35 @@ init_efi(void)
   4.136  	}
   4.137  	/* Getting efi function pointer for getEfiTime. */
   4.138  	machineFwG.efi.getTimeF =
   4.139 -		(efi_get_time_t)__va(SWAP((uint64_t)rsP->GetTime));
   4.140 +		(efi_get_time_t)__va((uint64_t)rsP->GetTime);
   4.141  	/* Getting efi function pointer for resetSystem. */
   4.142  	machineFwG.efi.resetSystemF =
   4.143 -		(efi_reset_system_t)__va(SWAP((uint64_t)rsP->ResetSystem));
   4.144 +		(efi_reset_system_t)__va((uint64_t)rsP->ResetSystem);
   4.145  
   4.146  	/* Scanning the Configuration table of the EfiSystemTable. */
   4.147  	PRINT_BV("NumberOfConfigTableEntries: %ld\n",
   4.148 -		 SWAP(efiSysTableP->NumberOfTableEntries));
   4.149 +		 efiSysTableP->NumberOfTableEntries);
   4.150  
   4.151  	confP = (efi_configuration_table_t*)
   4.152 -			__va(SWAP(efiSysTableP->ConfigurationTable));
   4.153 -	for (i = 0; i < SWAP(efiSysTableP->NumberOfTableEntries); i++) {
   4.154 +			__va(efiSysTableP->ConfigurationTable);
   4.155 +	for (i = 0; i < efiSysTableP->NumberOfTableEntries; i++) {
   4.156  		if (!efi_guid_cmp(&confP[i].VendorGuid, &sal)) {
   4.157  			machineFwG.ia64_sal_tableP = (sal_system_table_t*)
   4.158 -				__va(SWAP((uint64_t) confP[i].VendorTable));
   4.159 +				__va((uint64_t) confP[i].VendorTable);
   4.160  			PRINT_BV("  Found SalSystemTable at: 0x%lx\n",
   4.161  				 (uint64_t) machineFwG.ia64_sal_tableP);
   4.162  			continue;
   4.163  		}
   4.164  		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi)) {
   4.165  			machineFwG.ia64_efi_acpi_table =
   4.166 -				__va(SWAP((uint64_t) confP[i].VendorTable));
   4.167 +				__va((uint64_t) confP[i].VendorTable);
   4.168  			PRINT_BV("  Found AcpiTable at:      0x%lx\n",
   4.169  				 (uint64_t) machineFwG.ia64_efi_acpi_table);
   4.170  			continue;
   4.171  		}
   4.172  		if (!efi_guid_cmp(&confP[i].VendorGuid, &acpi20)) {
   4.173  			machineFwG.ia64_efi_acpi20_table =
   4.174 -				__va(SWAP((uint64_t) confP[i].VendorTable));
   4.175 +				__va((uint64_t) confP[i].VendorTable);
   4.176  			PRINT_BV("  Found Acpi20Table at:    0x%lx\n",
   4.177  				 (uint64_t) machineFwG.ia64_efi_acpi20_table);
   4.178  			continue;
     5.1 --- a/extras/mini-os/arch/ia64/fw.S	Mon Nov 17 09:27:02 2008 +0100
     5.2 +++ b/extras/mini-os/arch/ia64/fw.S	Tue Nov 18 10:55:51 2008 +0100
     5.3 @@ -155,11 +155,6 @@ ENTRY(ia64_call_efi_physical)
     5.4  	ld8	r14=[in0],8		// function address
     5.5  	;;
     5.6  	ld8	gp=[in0]		// function gp value
     5.7 -#if defined(BIG_ENDIAN)
     5.8 -	mux1	r14=r14,@rev		// swap because mini-os is in BE
     5.9 -	mov	ar.rsc=3
    5.10 -	;;
    5.11 -#endif
    5.12  	mov	out0=in1
    5.13  	mov	out1=in2
    5.14  	mov	out2=in3
    5.15 @@ -167,19 +162,7 @@ ENTRY(ia64_call_efi_physical)
    5.16  	mov	out4=in5
    5.17  	mov	b6=r14
    5.18  	;;
    5.19 -#if defined(BIG_ENDIAN)
    5.20 -	mux1	gp=gp,@rev		// swap because mini-os is in BE
    5.21 -	rum IA64_PSR_BE
    5.22 -	;;
    5.23 -#endif
    5.24 -
    5.25  	br.call.sptk.many rp=b6		// call EFI procedure
    5.26 -
    5.27 -#if defined(BIG_ENDIAN)
    5.28 -	;;
    5.29 -	sum IA64_PSR_BE
    5.30 -	mov	ar.rsc=IA64_RSE_EAGER
    5.31 -#endif
    5.32  	mov	gp=loc3			// restore kernel gp
    5.33  	mov	r14=loc2		// psr to restore mode
    5.34  	;;
    5.35 @@ -227,16 +210,8 @@ 1:	mov	palret=ip		// for return address
    5.36  	mov	b0=palret
    5.37  	rsm	psr.i			// disable interrupts
    5.38  	;;
    5.39 -#if defined(BIG_ENDIAN)
    5.40 -	rum	IA64_PSR_BE		// set psr.be==0
    5.41 -	;;
    5.42 -#endif
    5.43  	br.cond.sptk b6			// call into firmware
    5.44  	;;
    5.45 -#if defined(BIG_ENDIAN)
    5.46 -	sum	IA64_PSR_BE		// set psr.be==1
    5.47 -	;;
    5.48 -#endif
    5.49  	ssm	psr.i			// enable interrupts
    5.50  	;;
    5.51  2:	mov	psr.l=psrsave
    5.52 @@ -271,25 +246,9 @@ ENTRY(ia64_call_efi_func)
    5.53  	;;
    5.54  	ld8	gp=[in0]		// function gp value
    5.55  	;;
    5.56 -#if defined(BIG_ENDIAN)
    5.57 -	mux1	r14=r14,@rev		// swap if mini-os is in BE
    5.58 -	mux1	gp=gp,@rev		// swap if mini-os is in BE
    5.59 -#endif
    5.60 -	;;
    5.61  	mov	b6=r14
    5.62 -
    5.63 -#if defined(BIG_ENDIAN)
    5.64 -	rum	IA64_PSR_BE
    5.65 -	;;
    5.66 -#endif
    5.67 -
    5.68  	br.call.sptk.many rp=b6		// call EFI procedure
    5.69  	
    5.70 -#if defined(BIG_ENDIAN)
    5.71 -	sum	IA64_PSR_BE
    5.72 -	;;
    5.73 -#endif
    5.74 -	
    5.75  	mov	ar.pfs=loc0
    5.76  	mov	gp=loc1
    5.77  	mov	rp=loc2
     6.1 --- a/extras/mini-os/arch/ia64/ia64.S	Mon Nov 17 09:27:02 2008 +0100
     6.2 +++ b/extras/mini-os/arch/ia64/ia64.S	Tue Nov 18 10:55:51 2008 +0100
     6.3 @@ -205,10 +205,6 @@ 1:	/* now we are in virtual mode */
     6.4  	START_INFO_PFN_ld	r14=[r15]	// load the start_info_pfn
     6.5  	add	r16=7, r0
     6.6  	;;
     6.7 -#if defined(BIG_ENDIAN)
     6.8 -	mux1	r14=r14,@rev		// swap because mini-os is in BE
     6.9 -#endif
    6.10 -	;;
    6.11  	shl	r15=r14,PAGE_SHIFT_XEN_16K	// pfn << PAGE_SHIFT_XEN_16K
    6.12  	shl	r16=r16,IA64_RR_IDX_POS		// (7<<IA64_RR_IDX_POS)
    6.13  	;;
     7.1 --- a/extras/mini-os/arch/ia64/ivt.S	Mon Nov 17 09:27:02 2008 +0100
     7.2 +++ b/extras/mini-os/arch/ia64/ivt.S	Tue Nov 18 10:55:51 2008 +0100
     7.3 @@ -87,11 +87,6 @@ ENTRY(save_tf_rse_switch)
     7.4  	;;
     7.5  	ld8	r21=[r21]		// XEN.ipsr
     7.6  	ld8	r22=[r22];;		// XEN.iip
     7.7 -#if defined(BIG_ENDIAN)
     7.8 -	mux1	r21=r21,@rev		// swap because mini-os is in BE
     7.9 -	mux1	r22=r22,@rev		// swap because mini-os is in BE
    7.10 -	;;
    7.11 -#endif
    7.12  	add	r19=TF_IPSR,r18
    7.13  	add	r20=TF_IIP,r18
    7.14  	;;
    7.15 @@ -129,10 +124,6 @@ ENTRY(save_tf_rse_switch)
    7.16  	//bsw.1		// switch to bank 1 for saving these registers.
    7.17  	movl r30=XSI_BANKNUM		// Switch to bank 1.
    7.18  	mov r31=1;;
    7.19 -#if defined(BIG_ENDIAN)
    7.20 -	mux1	r31=r31,@rev		// swap because mini-os is in BE
    7.21 -	;;
    7.22 -#endif
    7.23  	st4 [r30]=r31
    7.24  	;;
    7.25  	/*
    7.26 @@ -143,38 +134,13 @@ ENTRY(save_tf_rse_switch)
    7.27  	movl r30=XSI_BANK1_R16;
    7.28  	movl r31=XSI_BANK1_R16+8;; 
    7.29  	ld8 r16=[r30],16; ld8 r17=[r31],16;;
    7.30 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.31 -	mux1	r16=r16,@rev; mux1 r17=r17,@rev;;
    7.32 -#endif
    7.33  	ld8 r18=[r30],16; ld8 r19=[r31],16;;
    7.34 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.35 -	mux1	r18=r18,@rev; mux1 r19=r19,@rev;;
    7.36 -#endif
    7.37  	ld8 r20=[r30],16; ld8 r21=[r31],16;;
    7.38 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.39 -	mux1	r20=r20,@rev; mux1 r21=r21,@rev;;
    7.40 -#endif
    7.41  	ld8 r22=[r30],16; ld8 r23=[r31],16;;
    7.42 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.43 -	mux1	r22=r22,@rev; mux1 r23=r23,@rev;;
    7.44 -#endif
    7.45  	ld8 r24=[r30],16; ld8 r25=[r31],16;;
    7.46 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.47 -	mux1	r24=r24,@rev; mux1 r25=r25,@rev;;
    7.48 -#endif
    7.49  	ld8 r26=[r30],16; ld8 r27=[r31],16;;
    7.50 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.51 -	mux1	r26=r26,@rev; mux1 r27=r27,@rev;;
    7.52 -#endif
    7.53  	ld8 r28=[r30],16; ld8 r29=[r31],16;;
    7.54 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.55 -	mux1	r28=r28,@rev; mux1 r29=r29,@rev;;
    7.56 -#endif
    7.57  	ld8 r30=[r30]; ld8 r31=[r31];;
    7.58 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.59 -	mux1	r30=r30,@rev; mux1 r31=r31,@rev;;
    7.60 -#endif
    7.61 -
    7.62  	add	r2=TF_GREG16,r14
    7.63  	add	r3=TF_GREG17,r14
    7.64  	;;
    7.65 @@ -251,10 +217,6 @@ ENTRY(save_tf_rse_switch)
    7.66  	;;
    7.67  	ld8	r21=[r8]
    7.68  	;;
    7.69 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.70 -	mux1	r21=r21,@rev
    7.71 -	;;
    7.72 -#endif
    7.73  	st8	[r19]=r21		// store cr.ifs
    7.74  	dep.z	r22=r21,0,38		// copy ifm part from ifs.ifm
    7.75  	;;
    7.76 @@ -330,12 +292,6 @@ ENTRY(restore_tf_rse_switch)
    7.77  	;;
    7.78  	ld8	r21=[r19]		// load cr.ipsr
    7.79  	ld8	r22=[r20]		// load cr.iip
    7.80 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
    7.81 -	;;
    7.82 -	mux1	r21=r21,@rev
    7.83 -	mux1	r22=r22,@rev
    7.84 -	;;
    7.85 -#endif
    7.86  	movl	r16=XSI_IPSR		// XEN !!
    7.87  	;;
    7.88  	st8	[r16]=r21,XSI_IIP_OFS-XSI_IPSR_OFS	// XEN.ipsr
    7.89 @@ -353,9 +309,6 @@ ENTRY(restore_tf_rse_switch)
    7.90  	ld8	r22=[r19]		// ndirty
    7.91  	;;
    7.92  	shl	r21=r22,16		// value for ar.rsc
    7.93 -	//mov	r19=(MOS_IA64_RSC_BE << IA64_RSC_BE)
    7.94 -	;;
    7.95 -	or	r21=(MOS_IA64_RSC_BE << IA64_RSC_BE),r21
    7.96  	;;
    7.97  	mov	ar.rsc=r21		// setup for loadrs
    7.98  	;;
    7.99 @@ -386,10 +339,6 @@ ENTRY(restore_tf_rse_switch)
   7.100  	ld8	r21=[r19]		// load ar.pfs
   7.101  	ld8	r22=[r20]		// load cr.ifs
   7.102  	;;
   7.103 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.104 -	mux1	r22=r22,@rev
   7.105 -	;;
   7.106 -#endif
   7.107  	add	r19=TF_RSC,r18
   7.108  	mov	ar.pfs=r21
   7.109  	st8	[r16]=r22		// XEN.ifs
   7.110 @@ -429,10 +378,6 @@ ENTRY(restore_tf_rse_switch)
   7.111  	// bsw.1
   7.112  	movl r30=XSI_BANKNUM		// Switch to bank 1.
   7.113  	mov r31=1;;
   7.114 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.115 -	mux1	r31=r31,@rev
   7.116 -	;;
   7.117 -#endif
   7.118  	st4 [r30]=r31
   7.119  	;;
   7.120  	add	r2=TF_GREG16,r14
   7.121 @@ -455,51 +400,27 @@ ENTRY(restore_tf_rse_switch)
   7.122  	movl r2=XSI_BANK1_R16
   7.123  	movl r3=XSI_BANK1_R16+8
   7.124  	;;
   7.125 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.126 -	mux1	r16=r16,@rev; mux1 r17=r17,@rev;;
   7.127 -#endif
   7.128  	.mem.offset 0,0; st8.spill [r2]=r16,16
   7.129  	.mem.offset 8,0; st8.spill [r3]=r17,16
   7.130  	;;
   7.131 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.132 -	mux1	r18=r18,@rev; mux1 r19=r19,@rev;;
   7.133 -#endif
   7.134  	.mem.offset 0,0; st8.spill [r2]=r18,16
   7.135  	.mem.offset 8,0; st8.spill [r3]=r19,16
   7.136  	;;
   7.137 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.138 -	mux1	r20=r20,@rev; mux1 r21=r21,@rev;;
   7.139 -#endif
   7.140  	.mem.offset 0,0; st8.spill [r2]=r20,16
   7.141  	.mem.offset 8,0; st8.spill [r3]=r21,16
   7.142  	;;
   7.143 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.144 -	mux1	r22=r22,@rev; mux1 r23=r23,@rev;;
   7.145 -#endif
   7.146  	.mem.offset 0,0; st8.spill [r2]=r22,16
   7.147  	.mem.offset 8,0; st8.spill [r3]=r23,16
   7.148  	;;
   7.149 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.150 -	mux1	r24=r24,@rev; mux1 r25=r25,@rev;;
   7.151 -#endif
   7.152  	.mem.offset 0,0; st8.spill [r2]=r24,16
   7.153  	.mem.offset 8,0; st8.spill [r3]=r25,16
   7.154  	;;
   7.155 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.156 -	mux1	r26=r26,@rev; mux1 r27=r27,@rev;;
   7.157 -#endif
   7.158  	.mem.offset 0,0; st8.spill [r2]=r26,16
   7.159  	.mem.offset 8,0; st8.spill [r3]=r27,16
   7.160  	;;
   7.161 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.162 -	mux1	r28=r28,@rev; mux1 r29=r29,@rev;;
   7.163 -#endif
   7.164  	.mem.offset 0,0; st8.spill [r2]=r28,16
   7.165  	.mem.offset 8,0; st8.spill [r3]=r29,16
   7.166  	;;
   7.167 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.168 -	mux1	r30=r30,@rev; mux1 r31=r31,@rev;;
   7.169 -#endif
   7.170  	.mem.offset 0,0; st8.spill [r2]=r30,16
   7.171  	.mem.offset 8,0; st8.spill [r3]=r31,16
   7.172  	;;
   7.173 @@ -567,17 +488,11 @@ ENTRY(save_special_regs)
   7.174  	add	loc5=TF_IFA,in0
   7.175  	add	loc6=TF_ISR,in0
   7.176  	;;
   7.177 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.178 -	mux1	loc3=loc3,@rev; mux1 loc4=loc4,@rev;;
   7.179 -#endif
   7.180  	st8	[loc5]=loc3,TF_IIM-TF_IFA	// store cr.ifa
   7.181  	st8	[loc6]=loc4			// store cr.isr
   7.182  	;;
   7.183  	ld8	loc3=[loc1]			// load XEN.iim
   7.184  	;;
   7.185 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.186 -	mux1	loc3=loc3,@rev;;
   7.187 -#endif
   7.188  	st8	[loc5]=loc3			// store cr.iim
   7.189  	;;
   7.190  	mov	ar.pfs=loc0
   7.191 @@ -605,9 +520,6 @@ ENTRY(hypervisor_callback)
   7.192  	mov	out0=r18		// the trap frame
   7.193  	movl	r22=XSI_PSR_IC
   7.194  	mov	r23=1;;
   7.195 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.196 -	mux1	r23=r23,@rev;;
   7.197 -#endif
   7.198  	st8	[r22]=r23		// ssm psr.ic
   7.199  	;;
   7.200  	br.call.sptk.few rp = do_hypervisor_callback
   7.201 @@ -649,9 +561,6 @@ ENTRY(trap_error)
   7.202  	;;
   7.203  	movl r30=XSI_BANKNUM		// bsw.1
   7.204  	mov r31=1;;
   7.205 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.206 -	mux1	r31=r31,@rev;;
   7.207 -#endif
   7.208  	st4 [r30]=r31;;
   7.209  
   7.210  		/* Save extra interrupt registers to the trap frame. */
   7.211 @@ -664,9 +573,6 @@ ENTRY(trap_error)
   7.212  	ld8	r23=[r23]
   7.213  	mov	r25=1
   7.214  	;;
   7.215 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.216 -	mux1	r25=r25,@rev; mux1 r23=r23,@rev;;
   7.217 -#endif
   7.218  	st4	[r22]=r25		// ssm psr.ic
   7.219  	st1	[r23]=r0		// ssm psr.i
   7.220  	;;
   7.221 @@ -680,10 +586,6 @@ ENTRY(trap_error)
   7.222  	ld8 r23=[r23]
   7.223  	mov r25=1
   7.224  	;;
   7.225 -#if defined(BIG_ENDIAN)			// swap because mini-os is in BE
   7.226 -	mux1	r25=r25,@rev;;
   7.227 -	mux1	r25=r25,@rev; mux1 r23=r23,@rev;;
   7.228 -#endif
   7.229  	st1 [r23]=r25
   7.230  	st4 [r22]=r0            // note: clears both vpsr.i and vpsr.ic!
   7.231  	;;
     8.1 --- a/extras/mini-os/arch/ia64/mm.c	Mon Nov 17 09:27:02 2008 +0100
     8.2 +++ b/extras/mini-os/arch/ia64/mm.c	Tue Nov 18 10:55:51 2008 +0100
     8.3 @@ -153,7 +153,7 @@ map_frames_ex(unsigned long* frames, uns
     8.4          ASSERT(n == 1 || (stride == 0 && increment == 1));
     8.5          ASSERT(id == DOMID_SELF);
     8.6          ASSERT(prot == 0);
     8.7 -	return (void*) __va(SWAP(frames[0]) << PAGE_SHIFT);
     8.8 +	return (void*) __va(frames[0] << PAGE_SHIFT);
     8.9  }
    8.10  
    8.11  void arch_init_p2m(unsigned long max_pfn)
     9.1 --- a/extras/mini-os/arch/ia64/sal.c	Mon Nov 17 09:27:02 2008 +0100
     9.2 +++ b/extras/mini-os/arch/ia64/sal.c	Tue Nov 18 10:55:51 2008 +0100
     9.3 @@ -76,19 +76,19 @@ ia64_sal_init(struct sal_system_table *s
     9.4  		return;
     9.5  	}
     9.6  	p = (uint8_t *) (saltab + 1);
     9.7 -	for (i = 0; i < SWAP(saltab->sal_entry_count); i++) {
     9.8 -		switch (SWAP(*p)) {
     9.9 +	for (i = 0; i < saltab->sal_entry_count; i++) {
    9.10 +		switch (*p) {
    9.11  		case SAL_DESC_ENTRYPOINT:		// 0
    9.12  		{
    9.13  			struct sal_entrypoint_descriptor *dp;
    9.14  
    9.15  			dp = (struct sal_entrypoint_descriptor*)p;
    9.16  			ia64_pal_entry =
    9.17 -				IA64_PHYS_TO_RR7(SWAP(dp->sale_pal_proc));
    9.18 +				IA64_PHYS_TO_RR7(dp->sale_pal_proc);
    9.19  			PRINT_BV("  PAL Proc at 0x%lx\n", ia64_pal_entry);
    9.20  			sal_fdesc.func =
    9.21 -				IA64_PHYS_TO_RR7(SWAP(dp->sale_sal_proc));
    9.22 -			sal_fdesc.gp = IA64_PHYS_TO_RR7(SWAP(dp->sale_sal_gp));
    9.23 +				IA64_PHYS_TO_RR7(dp->sale_sal_proc);
    9.24 +			sal_fdesc.gp = IA64_PHYS_TO_RR7(dp->sale_sal_gp);
    9.25  			PRINT_BV("  SAL Proc at 0x%lx, GP at 0x%lx\n",
    9.26  				 sal_fdesc.func, sal_fdesc.gp);
    9.27  			ia64_sal_entry = (sal_entry_t *) &sal_fdesc;
    10.1 --- a/extras/mini-os/arch/ia64/time.c	Mon Nov 17 09:27:02 2008 +0100
    10.2 +++ b/extras/mini-os/arch/ia64/time.c	Tue Nov 18 10:55:51 2008 +0100
    10.3 @@ -197,15 +197,6 @@ calculate_frequencies(void)
    10.4  	struct ia64_pal_result pal_res;
    10.5  
    10.6  	pal_res = ia64_call_pal_static(PAL_FREQ_RATIOS, 0, 0, 0);
    10.7 -	//sal_res = ia64_sal_call(SAL_FREQ_BASE, 0, 0, 0, 0, 0, 0, 0);
    10.8 -#if defined(BIG_ENDIAN)
    10.9 -//#warning calculate_frequencies TODO
   10.10 -	/*
   10.11 -	 * I have to do an own function with switching psr.be!
   10.12 -	 * Currently it's running because it's a break into the hypervisor
   10.13 -	 * behind the call.!
   10.14 -	 */
   10.15 -#endif
   10.16  	sal_res = ia64_sal_entry(SAL_FREQ_BASE, 0, 0, 0, 0, 0, 0, 0);
   10.17  
   10.18  	if (sal_res.sal_status == 0 && pal_res.pal_status == 0) {
   10.19 @@ -260,9 +251,8 @@ init_time(void)
   10.20  	if (efi_get_time(&tm)) {
   10.21  		printk("  EFI-Time: %d.%d.%d   %d:%d:%d\n", tm.Day,
   10.22  		       tm.Month, tm.Year, tm.Hour, tm.Minute, tm.Second);
   10.23 -		os_time.tv_sec = _mktime(SWAP(tm.Year), SWAP(tm.Month),
   10.24 -					SWAP(tm.Day), SWAP(tm.Hour),
   10.25 -					SWAP(tm.Minute), SWAP(tm.Second));
   10.26 +		os_time.tv_sec = _mktime(tm.Year, tm.Month,
   10.27 +					tm.Day, tm.Hour, tm.Minute, tm.Second);
   10.28  		os_time.tv_nsec = tm.Nanosecond;
   10.29  	} else
   10.30  		printk("efi_get_time() failed\n");
    11.1 --- a/extras/mini-os/arch/ia64/xencomm.c	Mon Nov 17 09:27:02 2008 +0100
    11.2 +++ b/extras/mini-os/arch/ia64/xencomm.c	Tue Nov 18 10:55:51 2008 +0100
    11.3 @@ -95,7 +95,7 @@ xencomm_init_desc(struct xencomm_desc *d
    11.4  			return -EINVAL;
    11.5  		}
    11.6  
    11.7 -		desc->address[i++] = SWAP(paddr);
    11.8 +		desc->address[i++] = paddr;
    11.9  		recorded += chunksz;
   11.10  	}
   11.11  	if (recorded < bytes) {
   11.12 @@ -106,8 +106,8 @@ xencomm_init_desc(struct xencomm_desc *d
   11.13  
   11.14  	/* mark remaining addresses invalid (just for safety) */
   11.15  	while (i < desc->nr_addrs)
   11.16 -		desc->address[i++] = SWAP(XENCOMM_INVALID);
   11.17 -	desc->magic = SWAP(XENCOMM_MAGIC);
   11.18 +		desc->address[i++] = XENCOMM_INVALID;
   11.19 +	desc->magic = XENCOMM_MAGIC;
   11.20  	return 0;
   11.21  }
   11.22  
   11.23 @@ -184,15 +184,14 @@ xencommize_mini_grant_table_op(struct xe
   11.24  			return -EINVAL;
   11.25  		rc = xencomm_create_mini
   11.26  		        (xc_area, nbr_area,
   11.27 -		         (void*)SWAP((uint64_t)
   11.28 -				     xen_guest_handle(setup->frame_list)),
   11.29 -		         SWAP(setup->nr_frames)
   11.30 +		         (void*)(uint64_t) xen_guest_handle(setup->frame_list),
   11.31 +		         setup->nr_frames
   11.32  		         * sizeof(*xen_guest_handle(setup->frame_list)),
   11.33  		         &desc1);
   11.34  		if (rc)
   11.35  			return rc;
   11.36  		set_xen_guest_handle(setup->frame_list,
   11.37 -				     (void *)SWAP((uint64_t)desc1));
   11.38 +				     (void *)(uint64_t)desc1);
   11.39  		break;
   11.40  	}
   11.41  	case GNTTABOP_dump_table:
   11.42 @@ -284,7 +283,7 @@ HYPERVISOR_suspend(unsigned long srec)
   11.43  {
   11.44          struct sched_shutdown arg;
   11.45  
   11.46 -        arg.reason = (uint32_t)SWAP((uint32_t)SHUTDOWN_suspend);
   11.47 +        arg.reason = (uint32_t)SHUTDOWN_suspend;
   11.48  
   11.49          return xencomm_arch_hypercall_suspend(xencomm_create_inline(&arg));
   11.50  }
   11.51 @@ -300,7 +299,7 @@ HYPERVISOR_event_channel_op(int cmd, voi
   11.52  	if (unlikely(rc == -ENOSYS)) {
   11.53  		struct evtchn_op op;
   11.54  
   11.55 -		op.cmd = SWAP(cmd);
   11.56 +		op.cmd = cmd;
   11.57  		memcpy(&op.u, arg, sizeof(op.u));
   11.58  		rc = _hypercall1(int, event_channel_op_compat, &op);
   11.59  	}
    12.1 --- a/extras/mini-os/include/ia64/atomic.h	Mon Nov 17 09:27:02 2008 +0100
    12.2 +++ b/extras/mini-os/include/ia64/atomic.h	Tue Nov 18 10:55:51 2008 +0100
    12.3 @@ -427,11 +427,10 @@ atomic_readandclear_64(volatile uint64_t
    12.4  static inline void
    12.5  set_bit(int num, volatile void *addr)
    12.6  {
    12.7 -	uint32_t bit, b, old, new;
    12.8 +	uint32_t bit, old, new;
    12.9  	volatile uint32_t *p;
   12.10  	p = (volatile uint32_t *) addr + (num >> 5);
   12.11 -	b = 1 << (num & 31);
   12.12 -	bit = SWAP(b);
   12.13 +	bit = 1 << (num & 31);
   12.14  	do
   12.15  	{
   12.16  		old = *p;
   12.17 @@ -442,11 +441,10 @@ set_bit(int num, volatile void *addr)
   12.18  static __inline__ void
   12.19  clear_bit(int num, volatile void *addr)
   12.20  {
   12.21 -	uint32_t mask, m,  old, new;
   12.22 +	uint32_t mask, old, new;
   12.23  	volatile uint32_t *p;
   12.24  	p = (volatile uint32_t *) addr + (num >> 5);
   12.25 -	m = ~(1 << (num & 31));
   12.26 -	mask = SWAP(m);
   12.27 +	mask = ~(1 << (num & 31));
   12.28  	do {
   12.29  		old = *p;
   12.30  		new = old & mask;
   12.31 @@ -456,7 +454,7 @@ clear_bit(int num, volatile void *addr)
   12.32  static __inline__ int
   12.33  test_bit(int num, const volatile void *addr)
   12.34  {
   12.35 -	uint32_t val = SWAP(1);
   12.36 +	uint32_t val = 1;
   12.37          return val & (((const volatile uint32_t *) addr)[num >> 5] >> (num & 31));
   12.38  }
   12.39  
   12.40 @@ -468,12 +466,11 @@ test_bit(int num, const volatile void *a
   12.41  static inline int
   12.42  test_and_set_bit (int num, volatile void *addr)
   12.43  {
   12.44 -        uint32_t bit, b, old, new;
   12.45 +        uint32_t bit, old, new;
   12.46          volatile uint32_t *m;
   12.47  
   12.48          m = (volatile uint32_t *) addr + (num >> 5);
   12.49 -        b = 1 << (num & 31);
   12.50 -        bit = SWAP(b);
   12.51 +        bit = 1 << (num & 31);
   12.52          do {
   12.53                  old = *m;
   12.54                  new = old | bit;
   12.55 @@ -489,12 +486,11 @@ test_and_set_bit (int num, volatile void
   12.56  static
   12.57  inline int test_and_clear_bit(int num, volatile unsigned long * addr)
   12.58  {
   12.59 -        uint32_t bit, b, old, new;
   12.60 +        uint32_t bit, old, new;
   12.61          volatile uint32_t* a;
   12.62  
   12.63          a = (volatile uint32_t *) addr + (num >> 5);
   12.64 -        b = ~(1 << (num & 31));
   12.65 -        bit = SWAP(b);
   12.66 +        bit = ~(1 << (num & 31));
   12.67          do {
   12.68                  old = *a;
   12.69                  new = old & bit;
    13.1 --- a/extras/mini-os/include/ia64/endian.h	Mon Nov 17 09:27:02 2008 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,75 +0,0 @@
    13.4 -/*
    13.5 - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
    13.6 - * Parts are taken from FreeBSD.
    13.7 - *
    13.8 - ****************************************************************************
    13.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   13.10 - * of this software and associated documentation files (the "Software"), to
   13.11 - * deal in the Software without restriction, including without limitation the
   13.12 - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   13.13 - * sell copies of the Software, and to permit persons to whom the Software is
   13.14 - * furnished to do so, subject to the following conditions:
   13.15 - * 
   13.16 - * The above copyright notice and this permission notice shall be included in
   13.17 - * all copies or substantial portions of the Software.
   13.18 - * 
   13.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   13.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   13.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   13.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   13.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   13.24 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   13.25 - * DEALINGS IN THE SOFTWARE.
   13.26 - */
   13.27 -
   13.28 -
   13.29 -#if !defined(_ENDIAN_H_)
   13.30 -#define _ENDIAN_H_
   13.31 -
   13.32 -#include <mini-os/types.h>
   13.33 -
   13.34 -
   13.35 -#if !defined(__ASSEMBLY__)
   13.36 -
   13.37 -#if defined(BIG_ENDIAN)
   13.38 -
   13.39 -static __inline uint64_t
   13.40 -__bswap64(uint64_t __x)
   13.41 -{
   13.42 -	uint64_t __r;
   13.43 -	asm __volatile("mux1 %0=%1,@rev" : "=r" (__r) : "r"(__x));
   13.44 -	return __r;
   13.45 -}
   13.46 -
   13.47 -static __inline uint32_t
   13.48 -__bswap32(uint32_t __x)
   13.49 -{
   13.50 -	return (__bswap64(__x) >> 32);
   13.51 -}
   13.52 -
   13.53 -static __inline uint16_t
   13.54 -__bswap16(uint16_t __x)
   13.55 -{
   13.56 -	return (__bswap64(__x) >> 48);
   13.57 -}
   13.58 -
   13.59 -#define doswap(x,sz)  ( \
   13.60 -	((sz)==1)? (uint8_t)(x): \
   13.61 -	((sz)==2)? __bswap16(x): \
   13.62 -	((sz)==4)? __bswap32(x): \
   13.63 -	((sz)==8)? __bswap64(x): \
   13.64 -	~0l )
   13.65 -
   13.66 -#define SWAP(x)	doswap((x), sizeof((x)))
   13.67 -
   13.68 -
   13.69 -#else /* defined(BIG_ENDIAN) */
   13.70 -
   13.71 -#define SWAP(x) (x)
   13.72 -
   13.73 -#endif /* defined(BIG_ENDIAN) */
   13.74 -
   13.75 -#endif /* !defined(__ASSEMBLY__) */
   13.76 -
   13.77 -
   13.78 -#endif /* !defined(_ENDIAN_H_) */
    14.1 --- a/extras/mini-os/include/ia64/ia64_cpu.h	Mon Nov 17 09:27:02 2008 +0100
    14.2 +++ b/extras/mini-os/include/ia64/ia64_cpu.h	Tue Nov 18 10:55:51 2008 +0100
    14.3 @@ -134,23 +134,16 @@
    14.4  #define IA64_PSR_IA		0x0000200000000000
    14.5  
    14.6  
    14.7 -/* Endianess of mini-os. */
    14.8 -#if defined(BIG_ENDIAN)
    14.9 -#define MOS_IA64_PSR_BE	IA64_PSR_BE
   14.10 -#else
   14.11 -#define MOS_IA64_PSR_BE	0
   14.12 -#endif
   14.13 -
   14.14  #define STARTUP_PSR (IA64_PSR_IT | IA64_PSR_PK | \
   14.15 -            	     IA64_PSR_DT | IA64_PSR_RT | MOS_IA64_PSR_BE | \
   14.16 +            	     IA64_PSR_DT | IA64_PSR_RT | \
   14.17  		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
   14.18  
   14.19  #define MOS_SYS_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
   14.20 -            	     IA64_PSR_DT | IA64_PSR_RT | MOS_IA64_PSR_BE | \
   14.21 +            	     IA64_PSR_DT | IA64_PSR_RT | \
   14.22  		     IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC)
   14.23  
   14.24  #define MOS_USR_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \
   14.25 -            	     IA64_PSR_DT | IA64_PSR_RT | MOS_IA64_PSR_BE | \
   14.26 +            	     IA64_PSR_DT | IA64_PSR_RT | \
   14.27  		     IA64_PSR_BN | IA64_PSR_CPL_USER | IA64_PSR_AC)
   14.28  
   14.29  /*
   14.30 @@ -193,14 +186,7 @@
   14.31  #define IA64_DCR_MBZ1_V		0xffffffffffffULL
   14.32  
   14.33  
   14.34 -	/* Endianess of DCR register. */
   14.35 -#if defined(BIG_ENDIAN)
   14.36 -#define MOS_IA64_DCR_BE	(1 << IA64_DCR_BE)
   14.37 -#else
   14.38 -#define MOS_IA64_DCR_BE	(0 << IA64_DCR_BE)
   14.39 -#endif
   14.40 -
   14.41 -#define IA64_DCR_DEFAULT (MOS_IA64_DCR_BE)
   14.42 +#define IA64_DCR_DEFAULT (IA64_DCR_BE)
   14.43  
   14.44  /*
   14.45   * Vector numbers for various ia64 interrupts.
   14.46 @@ -262,18 +248,8 @@
   14.47  #define IA64_RSC_MODE_LI (0x2) 		/* Load intensive */
   14.48  #define IA64_RSC_MODE_EA (0x3) 		/* Eager */
   14.49  
   14.50 -/* RSE endian mode. */
   14.51 -#if defined(BIG_ENDIAN)
   14.52 -#define MOS_IA64_RSC_BE	1		/* Big endian rse. */
   14.53 -#else
   14.54 -#define MOS_IA64_RSC_BE	0		/* Little endian rse. */
   14.55 -#endif
   14.56 -
   14.57 -#define IA64_RSE_EAGER ((IA64_RSC_MODE_EA<<IA64_RSC_MODE) |	\
   14.58 -			   (MOS_IA64_RSC_BE << IA64_RSC_BE)	)
   14.59 -
   14.60 -#define IA64_RSE_LAZY ((IA64_RSC_MODE_LY<<IA64_RSC_MODE) |	\
   14.61 -			   (MOS_IA64_RSC_BE << IA64_RSC_BE)	)
   14.62 +#define IA64_RSE_EAGER (IA64_RSC_MODE_EA<<IA64_RSC_MODE)
   14.63 +#define IA64_RSE_LAZY (IA64_RSC_MODE_LY<<IA64_RSC_MODE)
   14.64  
   14.65  
   14.66  
   14.67 @@ -719,19 +695,6 @@ typedef struct trap_frame trap_frame_t;
   14.68   */
   14.69  typedef struct
   14.70  {
   14.71 -#if defined(BIG_ENDIAN)
   14.72 -	uint64_t pte_ig	:11;	/* bits 53..63 */
   14.73 -	uint64_t pte_ed	:1;	/* bits 52..52 */
   14.74 -	uint64_t pte_rv2:2;	/* bits 50..51 */
   14.75 -	uint64_t pte_ppn:38;	/* bits 12..49 */
   14.76 -	uint64_t pte_ar	:3;	/* bits 9..11 */
   14.77 -	uint64_t pte_pl	:2;	/* bits 7..8 */
   14.78 -	uint64_t pte_d	:1;	/* bits 6..6 */
   14.79 -	uint64_t pte_a	:1;	/* bits 5..5 */
   14.80 -	uint64_t pte_ma	:3;	/* bits 2..4 */
   14.81 -	uint64_t pte_rv1:1;	/* bits 1..1 */
   14.82 -	uint64_t pte_p	:1;	/* bits 0..0 */
   14.83 -#else
   14.84  	uint64_t pte_p	:1;	/* bits 0..0 */
   14.85  	uint64_t pte_rv1:1;	/* bits 1..1 */
   14.86  	uint64_t pte_ma	:3;	/* bits 2..4 */
   14.87 @@ -743,7 +706,6 @@ typedef struct
   14.88  	uint64_t pte_rv2:2;	/* bits 50..51 */
   14.89  	uint64_t pte_ed	:1;	/* bits 52..52 */
   14.90  	uint64_t pte_ig	:11;	/* bits 53..63 */
   14.91 -#endif
   14.92  } ia64_pte_t;
   14.93  
   14.94  
    15.1 --- a/extras/mini-os/include/ia64/os.h	Mon Nov 17 09:27:02 2008 +0100
    15.2 +++ b/extras/mini-os/include/ia64/os.h	Tue Nov 18 10:55:51 2008 +0100
    15.3 @@ -28,7 +28,6 @@
    15.4  #if !defined(__ASSEMBLY__)
    15.5  
    15.6  #include <mini-os/types.h>
    15.7 -#include "endian.h"
    15.8  #include "ia64_cpu.h"
    15.9  #include "atomic.h"
   15.10  #include "efi.h"
   15.11 @@ -210,7 +209,7 @@ extern shared_info_t *HYPERVISOR_shared_
   15.12  do {									\
   15.13  	vcpu_info_t *_vcpu;						\
   15.14  	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
   15.15 -	_vcpu->evtchn_upcall_mask = SWAP(1);				\
   15.16 +	_vcpu->evtchn_upcall_mask = 1;					\
   15.17  	barrier();							\
   15.18  } while (0)
   15.19  
   15.20 @@ -221,7 +220,7 @@ do {									\
   15.21  	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
   15.22  	_vcpu->evtchn_upcall_mask = 0;					\
   15.23  	barrier(); /* unmask then check (avoid races) */		\
   15.24 -	if (unlikely(SWAP(_vcpu->evtchn_upcall_pending)))		\
   15.25 +	if (unlikely(_vcpu->evtchn_upcall_pending))			\
   15.26  		force_evtchn_callback();				\
   15.27  } while (0)
   15.28  
   15.29 @@ -229,7 +228,7 @@ do {									\
   15.30  do {									\
   15.31  	vcpu_info_t *_vcpu;						\
   15.32  	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
   15.33 -	(x) = SWAP(_vcpu->evtchn_upcall_mask);				\
   15.34 +	(x) = _vcpu->evtchn_upcall_mask;				\
   15.35  } while (0)
   15.36  
   15.37  #define __restore_flags(x)						\
   15.38 @@ -239,7 +238,7 @@ do {									\
   15.39  	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
   15.40  	if ((_vcpu->evtchn_upcall_mask = (x)) == 0) {			\
   15.41  		barrier(); /* unmask then check (avoid races) */	\
   15.42 -		if ( unlikely(SWAP(_vcpu->evtchn_upcall_pending)) )	\
   15.43 +		if ( unlikely(_vcpu->evtchn_upcall_pending) )		\
   15.44  			force_evtchn_callback();			\
   15.45  	}\
   15.46  } while (0)
   15.47 @@ -250,8 +249,8 @@ do {									\
   15.48  do {									\
   15.49  	vcpu_info_t *_vcpu;						\
   15.50  	_vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];	\
   15.51 -	(x) = SWAP(_vcpu->evtchn_upcall_mask);				\
   15.52 -	_vcpu->evtchn_upcall_mask = SWAP(1);				\
   15.53 +	(x) = _vcpu->evtchn_upcall_mask;				\
   15.54 +	_vcpu->evtchn_upcall_mask = 1;					\
   15.55  	barrier();							\
   15.56  } while (0)
   15.57  
   15.58 @@ -262,7 +261,7 @@ do {									\
   15.59  #define local_irq_enable()	__sti()
   15.60  
   15.61  #define irqs_disabled()			\
   15.62 -	SWAP(HYPERVISOR_shared_info->vcpu_info[smp_processor_id()].evtchn_upcall_mask)
   15.63 +	(HYPERVISOR_shared_info->vcpu_info[smp_processor_id()].evtchn_upcall_mask)
   15.64  
   15.65  /* This is a barrier for the compiler only, NOT the processor! */
   15.66  #define barrier() __asm__ __volatile__("": : :"memory")