[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/10] RISC-V: Add awareness for RISC-V reloations
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v3 07/10] RISC-V: Add awareness for RISC-V reloations |
Date: |
Wed, 21 Nov 2018 17:31:39 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Wed, Nov 21, 2018 at 05:08:09PM +0100, Andreas Schwab wrote:
> On Nov 21 2018, Daniel Kiper <address@hidden> wrote:
>
> >> + case R_RISCV_BRANCH:
> >> + {
> >> + grub_uint32_t *abs_place = place;
> >> + grub_ssize_t off = sym_addr - (grub_addr_t) place;
> >> + grub_uint32_t imm12 = (off & 0x1000) << (31 - 12);
> >> + grub_uint32_t imm11 = (off & 0x800) >> (11 - 7);
> >> + grub_uint32_t imm10_5 = (off & 0x7e0) << (30 - 10);
> >> + grub_uint32_t imm4_1 = (off & 0x1e) << (11 - 4);
> >> + *abs_place = (*abs_place & 0x1fff07f)
> >> + | imm12 | imm11 | imm10_5 | imm4_1;
> >
> > Could not we use some constants instead of numbers here?
>
> These are just where the insn encoding puts the bits.
>
> > If this does not make sense than please name the source of this numbers.
>
> https://github.com/riscv/riscv-isa-manual/blob/master/release/riscv-spec-v2.2.pdf
OK, please add the document title and link to it into relevant source files.
Daniel
- Re: [PATCH v3 10/10] fdt: Add device tree file type, (continued)
Re: [PATCH v3 10/10] fdt: Add device tree file type, Daniel Kiper, 2018/11/21
[PATCH v3 01/10] efi: Rename armxx to arch, Alexander Graf, 2018/11/14
[PATCH v3 03/10] elf.h: Add RISC-V definitions, Alexander Graf, 2018/11/14
[PATCH v3 07/10] RISC-V: Add awareness for RISC-V reloations, Alexander Graf, 2018/11/14
[PATCH v3 06/10] RISC-V: Add Linux load logic, Alexander Graf, 2018/11/14
[PATCH v3 09/10] RISC-V: Add to build system, Alexander Graf, 2018/11/14
Re: [PATCH v3 09/10] RISC-V: Add to build system, Daniel Kiper, 2018/11/21