Re: [Boost-bugs] [Boost C++ Libraries] #9743: Patch for context/coroutine assembler for Linux On Power (BE & LE)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9743: Patch for context/coroutine assembler for Linux On Power (BE & LE)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-06 14:32:46


#9743: Patch for context/coroutine assembler for Linux On Power (BE & LE)
--------------------------------------+---------------------
  Reporter: Tony Reix <tony.reix@…> | Owner: olli
      Type: Patches | Status: new
 Milestone: To Be Determined | Component: context
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+---------------------

Comment (by Tony Reix <tony.reix@…>):

 Hi,

 I'm nuts about complex assembler stuff. However I'm helped by an expert.
 He has found the following:

 1) First, it seems that the API of jump_fcontext() has been changed (from
 1.55 to today).

 intptr_t jump_fcontext( fcontext_t * ofc, '''fcontext_t const*''' nfc,
 intptr_t vp, bool preserve_fpu = true);

 =>

 intptr_t jump_fcontext( fcontext_t * ofc, '''fcontext_t''' nfc, intptr_t
 vp, bool preserve_fpu = true);


 2) It seems that you have made changes for Power that are not valid for
 Linux on Power (LoP), both BE and LE.

 So, we propose the following changes (see files that I gonna attach to the
 ticket) that are valid to Linux on PowerPC Big Endian or Little Endian
 (there is only 64bits systems, no 32bits systems):

   - make_fcontext :
       - use of 64bits opcodes (std instead of stw)
       - about ELFv1 case: we grab the address and TOC of the context
 function.

   - jump_fcontext :
       - about ELFv1 case: we save/restore the TOC.
       - we don't save/restore R13
       - about ELFv2: the address of the context function is passed through
 R12

 4) We use the Macros:
      _CALL_ELF == 2
      _CALL_LINUX

 3) These jump/make files must be preprocessed by cpp, in order to process
 the Macros. I'm not sure that it works now with Jamfile.v2. My colleague
 tested his code in a much simpler environment. I gonna check asap.


 We have tested the files I gonna attach both on LoP BE and LE. Only
 64bits.
   jump_ppc64_sysv_elf_gas.S
   make_ppc64_sysv_elf_gas.S
 In order to prevent confusion, I suggest that either you rename these 2
 files another way (jump/make_ppc64_linux_elf_gas.S) or you mix all
 versions together (which may be difficult to maintain). I would suggest
 first solution. However, I do not yet master what the Jamfile.v2 of
 context lib does.

 Regards,

 Tony

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9743#comment:9>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC