# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 02c6bf903a8e0824e0c5ac07b7f85b9669316c45
# Parent c759c733f77d5edaa21620f37206521399842023
[XEN] Undo changset 13191 to make way for better patch
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
xen/common/domctl.c | 40 +++------------------------------------
xen/include/asm-powerpc/bitops.h | 3 --
xen/include/xen/bitops.h | 4 ---
3 files changed, 4 insertions(+), 43 deletions(-)
diff -r c759c733f77d -r 02c6bf903a8e xen/common/domctl.c
--- a/xen/common/domctl.c Wed Jan 17 14:12:08 2007 -0500
+++ b/xen/common/domctl.c Wed Jan 17 14:17:31 2007 -0500
@@ -38,36 +38,14 @@ void cpumask_to_xenctl_cpumap(
void cpumask_to_xenctl_cpumap(
struct xenctl_cpumap *xenctl_cpumap, cpumask_t *cpumask)
{
- unsigned int guest_bytes, copy_bytes, xen_bytes, i;
+ unsigned int guest_bytes, copy_bytes, i;
uint8_t zero = 0;
- cpumask_t local;
if ( guest_handle_is_null(xenctl_cpumap->bitmap) )
return;
guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
-
- xen_bytes = (NR_CPUS + 7) / 8;
- if (bitmap_by_long) {
- if (((guest_bytes * 8) % BITS_PER_LONG) != 0) {
- printk("%s: Unable to translate bitmap\n", __func__);
- return;
- }
-
- /* local copy */
- memcpy(cpus_addr(local), cpus_addr(*cpumask), sizeof (local));
-
- /* clear unused bits */
- for (i = NR_CPUS; i < sizeof(local) * 8; i++) {
- /* non-atomic version */
- __clear_bit(i, cpus_addr(local));
- }
-
- xen_bytes = sizeof(local);
- cpumask = &local;
- }
-
- copy_bytes = min_t(unsigned int, guest_bytes, xen_bytes);
+ copy_bytes = min_t(unsigned int, guest_bytes, (NR_CPUS + 7) / 8);
copy_to_guest(xenctl_cpumap->bitmap,
(uint8_t *)cpus_addr(*cpumask),
@@ -80,20 +58,10 @@ void xenctl_cpumap_to_cpumask(
void xenctl_cpumap_to_cpumask(
cpumask_t *cpumask, struct xenctl_cpumap *xenctl_cpumap)
{
- unsigned int guest_bytes, copy_bytes, xen_bytes;
+ unsigned int guest_bytes, copy_bytes;
guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
- xen_bytes = (NR_CPUS + 7) / 8;
-
- if (bitmap_by_long) {
- if (((guest_bytes * 8) % BITS_PER_LONG) != 0) {
- printk("%s: Unable to translate bitmap\n", __func__);
- return;
- }
- xen_bytes = sizeof(*cpumask);
- }
-
- copy_bytes = min_t(unsigned int, guest_bytes, xen_bytes);
+ copy_bytes = min_t(unsigned int, guest_bytes, (NR_CPUS + 7) / 8);
cpus_clear(*cpumask);
diff -r c759c733f77d -r 02c6bf903a8e xen/include/asm-powerpc/bitops.h
--- a/xen/include/asm-powerpc/bitops.h Wed Jan 17 14:12:08 2007 -0500
+++ b/xen/include/asm-powerpc/bitops.h Wed Jan 17 14:17:31 2007 -0500
@@ -41,9 +41,6 @@
#define _PPC64_BITOPS_H
#include <asm/memory.h>
-
-/* The following indicates that bitops are implemented as described above */
-#define bitmap_by_long (1)
/*
* clear_bit doesn't imply a memory barrier
diff -r c759c733f77d -r 02c6bf903a8e xen/include/xen/bitops.h
--- a/xen/include/xen/bitops.h Wed Jan 17 14:12:08 2007 -0500
+++ b/xen/include/xen/bitops.h Wed Jan 17 14:17:31 2007 -0500
@@ -75,10 +75,6 @@ static __inline__ int generic_fls(int x)
* scope
*/
#include <asm/bitops.h>
-
-#ifndef bitmap_by_long
-#define bitmap_by_long (0)
-#endif
static inline int generic_fls64(__u64 x)
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|