Contiki 3.x
elfloader-arch-otf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005, Swedish Institute of Computer Science
3  * Copyright (c) 2007, Simon Berg
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * 3. Neither the name of the Institute nor the names of its contributors
15  * may be used to endorse or promote products derived from this software
16  * without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * This file is part of the Contiki operating system.
31  *
32  */
33 /**
34  * \addtogroup elfloader
35  * @{
36  */
37 
38 /**
39  * \defgroup elfloaderarch Architecture specific functionality for the ELF loader.
40  *
41  * The architecture specific functionality for the Contiki ELF loader
42  * has to be implemented for each processor type Contiki runs on.
43  *
44  * Since the ELF format is slightly different for different processor
45  * types, the Contiki ELF loader is divided into two parts: the
46  * generic ELF loader module (\ref elfloader) and the architecture
47  * specific part (this module). The architecture specific part deals
48  * with memory allocation, code and data relocation, and writing the
49  * relocated ELF code into program memory.
50  *
51  * To port the Contiki ELF loader to a new processor type, this module
52  * has to be implemented for the new processor type.
53  *
54  * @{
55  */
56 
57 /**
58  * \file
59  * Header file for the architecture specific parts of the Contiki ELF loader.
60  *
61  * \author
62  * Adam Dunkels <adam@sics.se>
63  *
64  */
65 
66 #ifndef ELFLOADER_ARCH_H_
67 #define ELFLOADER_ARCH_H_
68 
69 #include "elfloader-otf.h"
70 
71 
72 /**
73  * \brief Perform a relocation.
74  * \param input_fd The file descriptor for the ELF file.
75  * \param output The output object for the segment.
76  * \param sectionoffset The file offset at which the relocation can be found.
77  * \param sectionaddr The section start address (absolute runtime).
78  * \param rela A pointer to an ELF32 rela structure (struct elf32_rela).
79  * \param addr The relocated address.
80  *
81  * This function is called from the Contiki ELF loader to
82  * perform a relocation on a piece of code or data. The
83  * relocated address is calculated by the Contiki ELF
84  * loader, based on information in the ELF file, and it is
85  * the responsibility of this function to patch the
86  * executable code. The Contiki ELF loader passes a
87  * pointer to an ELF32 rela structure (struct elf32_rela)
88  * that contains information about how to patch the
89  * code. This information is different from processor to
90  * processor.
91  */
92 int elfloader_arch_relocate(int input_fd,
93  struct elfloader_output *output,
94  unsigned int sectionoffset,
95  char *sectionaddr,
96  struct elf32_rela *rela, char *addr);
97 
98 #endif /* ELFLOADER_ARCH_H_ */
99 
100 /** @} */
101 /** @} */
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Definition: uip-nd6.c:124
Header file for the Contiki ELF loader.
elfloader output object
int elfloader_arch_relocate(int input_fd, struct elfloader_output *output, unsigned int sectionoffset, char *sectionaddr, struct elf32_rela *rela, char *addr)
Perform a relocation.
Definition: elfloader-arm.c:22
static uint8_t output(const uip_lladdr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
Definition: sicslowpan.c:1275