All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH v2] Ensure that MIPS target code is compiled for the O32 ABI.
Date: Fri, 9 Oct 2015 23:14:44 +0200	[thread overview]
Message-ID: <56182E44.8010306@gmail.com> (raw)
In-Reply-To: <55F5186E.5040306@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]

On 13.09.2015 08:32, Andrei Borzenkov wrote:
> 08.09.2015 20:11, Vladimir 'φ-coder/phcoder' Serbinenko пишет:
>> On 23.08.2015 23:50, Mark H Weaver wrote:
>>> Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
>>> code for the O32 ABI when targetting MIPS, since the MIPS assembly code
>>> in GRUB assumes this.
>> Could you be more precise where we assume this? Why not fix the assembly
>> instead?
> 
> If I understand it correctly, this is not only about assembly - ABIs
> differ in sizes of types as well,
Only in obscure types long double and uint128_t. We use neither.
> so we'd need to define whole new CPU
> in grub.
Nope
> Not sure if it's worth it. We can consider ourselves lucky it
> was caught that early.
The differences are:
* Use of rela instead of rel section. (I've prepared a patch)
* Register names: There is no $t5 but there is $a5. I prepared a draft,
cleaning up
* Different parameter/result passing in presence of either
  a) >4 parameters
  b) floats
  c) 64-bit integers
  d) structs
 Neither happens between C and assembly. In all we have only following
interfaces between C and assembly:
  a) Relocator call. No arguments void (*) (void);
  b) void grub_main(void);
  c) void
grub_decompress_core (void *src, void *dst, unsigned long srcsize,
		      unsigned long dstsize);
  d) void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t
len);
  e) void grub_arch_sync_dma_caches (void *address, grub_size_t len);
  f) int grub_setjmp (grub_jmp_buf env) // grub_jmp_buf is an array, so
pointer
  g) int grub_longjmp (grub_jmp_buf env, int val)
* $gp is caller vs callee-saved. We don't use $gp in assembly except in
setjmp which is already appropriate for n32.
So, we need just few cleanups to make it work. Whether we want to
continuously maintain this compatibility is another question. I'm going
to commit the fixes




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  reply	other threads:[~2015-10-09 21:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 18:35 [PATCH] Ensure that MIPS target code is compiled for the O32 ABI Mark H Weaver
2015-08-21  4:05 ` Andrei Borzenkov
2015-08-22 18:04   ` Mark H Weaver
2015-08-23  9:51     ` Andrei Borzenkov
2015-08-23 17:27       ` Mark H Weaver
2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-09-09  1:37           ` Mark H Weaver
2015-09-13  6:32           ` Andrei Borzenkov
2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-14  4:49                 ` Andrei Borzenkov
2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
2015-10-14 17:57                     ` Andrei Borzenkov
2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
2015-08-24  7:57       ` Mark H Weaver
2015-08-24  8:12         ` Andrei Borzenkov
2015-08-24  9:27           ` Andrei Borzenkov
2015-08-25 18:18             ` Mark H Weaver
2015-09-11 15:06               ` Andrei Borzenkov
2015-09-13  2:41                 ` Mark H Weaver
2015-09-13  3:46                   ` Mark H Weaver
2015-09-13 14:10                   ` Andrei Borzenkov
2015-09-13 23:37                     ` Mark H Weaver
2015-09-20  4:44                       ` Andrei Borzenkov
2015-09-21 16:09                         ` Mark H Weaver
2015-09-21 17:56                           ` Andrei Borzenkov
2015-09-22 15:03                             ` Mark H Weaver
2015-09-22 17:26                               ` Andrei Borzenkov

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=56182E44.8010306@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.