All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5@us.ibm.com>
To: Arun Sharma <arun.sharma@intel.com>
Cc: xen-devel@xensource.com, xen-devel <xen-devel@lists.sourceforge.net>
Subject: Re: [PATCH] tools top level makefile cleanup
Date: Wed, 23 Mar 2005 14:41:09 -0600	[thread overview]
Message-ID: <1111610470.4741.21.camel@thinkpad> (raw)
In-Reply-To: <4240A373.7080406@intel.com>

Hmmm.. one cheap way to get around this and keep things nice for cross
compiling is to to include thek Rules.mk file at the top level of the
tools directory and have  something like

ifeq ($(XEN_TARGET_ARCH),x86_32)
LDLIBS= $(BXLIBS) -L/usr/X11R6/lib -lX11 -lXpm -lstdc++ -
L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread
-lncurses_32)
endif

ifeq ($(XEN_TARGET_ARCH),x86_64)
DLIBS= $(BXLIBS) -L/usr/X11R6/lib64 -lX11 -lXpm -lstdc++ -
L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread
-lncurses
endif


This is cheap and easy way to get around the problem.  

On Tue, 2005-03-22 at 15:00 -0800, Arun Sharma wrote:
> On 3/22/2005 1:10 PM, Jerone Young wrote:
> > I cleaned up the top level makefile in the tools directory. No major
> > changes. Except I have it so that ioemmu is compiled only with x86_32. 
> > 
> > Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> 
> We've been using the attached patch internally. The patch breaks x86_32. I'd appreciate help from someone who groks makefiles better than I do in fixing up the lib vs lib64 part.
> 
> 	-Arun
> plain text document attachment (ioemu-x86-64.patch)
> ===== tools/ioemu/iodev/Makefile 1.4 vs edited =====
> --- 1.4/tools/ioemu/iodev/Makefile	2005-02-14 16:54:33 -08:00
> +++ edited/tools/ioemu/iodev/Makefile	2005-03-22 14:51:13 -08:00
> @@ -2,7 +2,7 @@
>  CXXFLAGS=-I. -I../include -I..
>  OBJS=$(patsubst %.cc,%.o,$(wildcard *.cc))
>  BXLIBS = ../gui/libgui.a ../memory/libmemory.a  
> -LDLIBS= $(BXLIBS) -L/usr/X11R6/lib -lX11 -lXpm -lstdc++ -L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses
> +LDLIBS= $(BXLIBS) -L/usr/X11R6/lib64 -lX11 -lXpm -lstdc++ -L ../../../tools/libxc -L ../../../tools/libxutil -lxc -lxutil -lpthread -lncurses
>  
>  all: device-model
>  
> ===== tools/ioemu/iodev/cpu.cc 1.6 vs edited =====
> --- 1.6/tools/ioemu/iodev/cpu.cc	2005-02-08 15:57:15 -08:00
> +++ edited/tools/ioemu/iodev/cpu.cc	2005-03-22 14:48:34 -08:00
> @@ -102,20 +102,20 @@
>  
>  				for (i = 0; i < req->count; i++) {
>  					tmp = BX_INP(req->addr, req->size);
> -					BX_MEM_WRITE_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), 
> +					BX_MEM_WRITE_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), 
>  							       req->size, &tmp);
>  				}
>  			}
>  		} else if(req->dir == IOREQ_WRITE) {
>  			if (!req->pdata_valid) {
> -				BX_OUTP(req->addr, (Bit32u) req->u.data, req->size);
> +				BX_OUTP(req->addr, (dma_addr_t) req->u.data, req->size);
>  			} else {
>  				for (i = 0; i < req->count; i++) {
>  					unsigned long tmp;
>  
> -					BX_MEM_READ_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), req->size, 
> +					BX_MEM_READ_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), req->size, 
>  							 &tmp);
> -					BX_OUTP(req->addr, (Bit32u) tmp, req->size);
> +					BX_OUTP(req->addr, (dma_addr_t) tmp, req->size);
>  				}
>  			}
>  			
> @@ -133,12 +133,12 @@
>  				//BX_INFO(("<READ>addr:%llx, pdata:%llx, size: %x, count: %x\n", req->addr, req->u.pdata, req->size, req->count));
>  				for (i = 0; i < req->count; i++) {
>  					BX_MEM_READ_PHYSICAL(req->addr + (sign * i * req->size), req->size, &tmp);
> -					BX_MEM_WRITE_PHYSICAL((Bit32u) req->u.pdata + (sign * i * req->size), req->size, &tmp);
> +					BX_MEM_WRITE_PHYSICAL((dma_addr_t) req->u.pdata + (sign * i * req->size), req->size, &tmp);
>  				}
>  			} else if (req->dir == IOREQ_WRITE) {
>  				//BX_INFO(("<WRITE>addr:%llx, pdata:%llx, size: %x, count: %x\n", req->addr, req->u.pdata, req->size, req->count));
>  				for (i = 0; i < req->count; i++) {
> -					BX_MEM_READ_PHYSICAL((Bit32u)req->u.pdata + (sign * i * req->size), req->size, &tmp);
> +					BX_MEM_READ_PHYSICAL((dma_addr_t)req->u.pdata + (sign * i * req->size), req->size, &tmp);
>  					BX_MEM_WRITE_PHYSICAL(req->addr + (sign * i * req->size), req->size, &tmp);
>  				}
>  			}
> @@ -245,6 +245,7 @@
>  	}
>  }
>  
> +#ifdef __i386__
>  static __inline__ void set_bit(long nr, volatile void *addr)
>  {
>  	__asm__ __volatile__( "lock ; "
> @@ -254,6 +255,18 @@
>  
>  	return;
>  }
> +#else 
> +/* XXX: clean for IPF */
> +static __inline__ void set_bit(long nr, volatile void *addr)
> +{
> +	__asm__ __volatile__( "lock ; "
> +		"btsq %1,%0"
> +		:"=m" ((*(volatile long *)addr))
> +		:"Ir" (nr));
> +
> +	return;
> +}
> +#endif
>  
>  void
>  bx_cpu_c::interrupt(Bit8u vector)
> ===== tools/ioemu/memory/memory.cc 1.1 vs edited =====
> --- 1.1/tools/ioemu/memory/memory.cc	2005-01-10 14:19:25 -08:00
> +++ edited/tools/ioemu/memory/memory.cc	2005-03-22 14:48:34 -08:00
> @@ -36,7 +36,7 @@
>  #if BX_PROVIDE_CPU_MEMORY
>  
>    void BX_CPP_AttrRegparmN(3)
> -BX_MEM_C::writePhysicalPage(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *data)
> +BX_MEM_C::writePhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, unsigned len, void *data)
>  {
>    Bit8u *data_ptr;
>    Bit32u a20addr;
> @@ -235,7 +235,7 @@
>  
> 
>    void BX_CPP_AttrRegparmN(3)
> -BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *data)
> +BX_MEM_C::readPhysicalPage(BX_CPU_C *cpu, dma_addr_t addr, unsigned len, void *data)
>  {
>    Bit8u *data_ptr;
>    Bit32u a20addr;
> ===== tools/ioemu/memory/memory.h 1.1 vs edited =====
> --- 1.1/tools/ioemu/memory/memory.h	2005-01-10 14:19:25 -08:00
> +++ edited/tools/ioemu/memory/memory.h	2005-03-22 14:48:35 -08:00
> @@ -37,6 +37,12 @@
>  #  define BX_MEM_THIS this->
>  #endif
>  
> +#if defined(__i386__)
> +typedef Bit32u dma_addr_t;
> +#elif defined(__x86_64__)
> +typedef Bit64u dma_addr_t;
> +#endif
> +
>  // alignment of memory vector, must be a power of 2
>  #define BX_MEM_VECTOR_ALIGN 4096
>  
> @@ -64,9 +70,9 @@
>    ~BX_MEM_C(void);
>    BX_MEM_SMF void    alloc_vector_aligned (size_t bytes, size_t alignment) BX_CPP_AttrRegparmN(2);
>    BX_MEM_SMF void    init_memory(int memsize);
> -  BX_MEM_SMF void    readPhysicalPage(BX_CPU_C *cpu, Bit32u addr,
> +  BX_MEM_SMF void    readPhysicalPage(BX_CPU_C *cpu, dma_addr_t addr,
>                                        unsigned len, void *data) BX_CPP_AttrRegparmN(3);
> -  BX_MEM_SMF void    writePhysicalPage(BX_CPU_C *cpu, Bit32u addr,
> +  BX_MEM_SMF void    writePhysicalPage(BX_CPU_C *cpu, dma_addr_t addr,
>                                         unsigned len, void *data) BX_CPP_AttrRegparmN(3);
>    BX_MEM_SMF void    load_ROM(const char *path, Bit32u romaddress, Bit8u type);
>    BX_MEM_SMF Bit32u  get_memory_in_k(void);
-- 
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)



-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click

       reply	other threads:[~2005-03-23 20:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1111526259.18440@unix-os.sc.intel.com>
     [not found] ` <4240A373.7080406@intel.com>
2005-03-23 20:41   ` Jerone Young [this message]
     [not found] <488257396@toto.iv>
2005-03-24 14:56 ` [PATCH] tools top level makefile cleanup Jimi Xenidis
2005-03-22 22:25 Nakajima, Jun
  -- strict thread matches above, loose matches on Subject: below --
2005-03-22 22:18 Nakajima, Jun
2005-03-22 22:14 ` Jerone Young
2005-03-22 21:10 Jerone Young
2005-03-22 21:33 ` Adam Heath
2005-03-22 21:46   ` Jerone Young
2005-03-23 18:01     ` Adam Heath
2005-03-23 20:15       ` Hollis Blanchard
2005-03-23 20:48         ` Anthony Liguori
2005-03-23 20:57           ` Hollis Blanchard
2005-03-24 20:13             ` Adam Heath
2005-03-24 20:08           ` Adam Heath
2005-03-24 20:07         ` Adam Heath
2005-03-23 21:11 ` Christian Limpach
2005-03-23 21:17   ` Hollis Blanchard
2005-03-23 22:35     ` Christian Limpach
2005-03-24 20:11   ` Adam Heath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1111610470.4741.21.camel@thinkpad \
    --to=jyoung5@us.ibm.com \
    --cc=arun.sharma@intel.com \
    --cc=xen-devel@lists.sourceforge.net \
    --cc=xen-devel@xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.