/branches/tracing/kernel/generic/src/ipc/ipc.c |
---|
37,9 → 37,7 |
* First the answerbox, then the phone. |
*/ |
#include <synch/synch.h> |
#include <synch/spinlock.h> |
#include <synch/mutex.h> |
#include <synch/waitq.h> |
#include <synch/synch.h> |
#include <ipc/ipc.h> |
143,7 → 141,7 |
*/ |
void ipc_phone_connect(phone_t *phone, answerbox_t *box) |
{ |
mutex_lock(&phone->lock); |
spinlock_lock(&phone->lock); |
phone->state = IPC_PHONE_CONNECTED; |
phone->callee = box; |
152,7 → 150,7 |
list_append(&phone->link, &box->connected_phones); |
spinlock_unlock(&box->lock); |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
} |
/** Initialize a phone structure. |
161,7 → 159,7 |
*/ |
void ipc_phone_init(phone_t *phone) |
{ |
mutex_initialize(&phone->lock); |
spinlock_initialize(&phone->lock, "phone_lock"); |
phone->callee = NULL; |
phone->state = IPC_PHONE_FREE; |
atomic_set(&phone->active_calls, 0); |
264,9 → 262,9 |
{ |
answerbox_t *box; |
mutex_lock(&phone->lock); |
spinlock_lock(&phone->lock); |
if (phone->state != IPC_PHONE_CONNECTED) { |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
if (call->flags & IPC_CALL_FORWARDED) { |
IPC_SET_RETVAL(call->data, EFORWARD); |
_ipc_answer_free_call(call); |
281,7 → 279,7 |
box = phone->callee; |
_ipc_call(phone, box, call); |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
return 0; |
} |
300,11 → 298,11 |
answerbox_t *box; |
call_t *call; |
mutex_lock(&phone->lock); |
spinlock_lock(&phone->lock); |
if (phone->state == IPC_PHONE_FREE || |
phone->state == IPC_PHONE_HUNGUP || |
phone->state == IPC_PHONE_CONNECTING) { |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
return -1; |
} |
box = phone->callee; |
323,7 → 321,7 |
} |
phone->state = IPC_PHONE_HUNGUP; |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
return 0; |
} |
449,7 → 447,7 |
while (!list_empty(&box->connected_phones)) { |
phone = list_get_instance(box->connected_phones.next, |
phone_t, link); |
if (SYNCH_FAILED(mutex_trylock(&phone->lock))) { |
if (!spinlock_trylock(&phone->lock)) { |
spinlock_unlock(&box->lock); |
interrupts_restore(ipl); |
DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD); |
463,7 → 461,7 |
phone->state = IPC_PHONE_SLAMMED; |
if (notify_box) { |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
spinlock_unlock(&box->lock); |
interrupts_restore(ipl); |
484,7 → 482,7 |
goto restart_phones; |
} |
mutex_unlock(&phone->lock); |
spinlock_unlock(&phone->lock); |
} |
spinlock_unlock(&box->lock); |
627,10 → 625,7 |
/* Print opened phones & details */ |
printf("PHONE:\n"); |
for (i = 0; i < IPC_MAX_PHONES; i++) { |
if (SYNCH_FAILED(mutex_trylock(&task->phones[i].lock))) { |
printf("%d: mutex busy\n", i); |
continue; |
} |
spinlock_lock(&task->phones[i].lock); |
if (task->phones[i].state != IPC_PHONE_FREE) { |
printf("%d: ", i); |
switch (task->phones[i].state) { |
655,7 → 650,7 |
printf("active: %d\n", |
atomic_get(&task->phones[i].active_calls)); |
} |
mutex_unlock(&task->phones[i].lock); |
spinlock_unlock(&task->phones[i].lock); |
} |
674,7 → 669,7 |
} |
/* Print answerbox - calls */ |
printf("ABOX - DISPATCHED CALLS:\n"); |
for (tmp = task->answerbox.dispatched_calls.next; |
for (tmp=task->answerbox.dispatched_calls.next; |
tmp != &task->answerbox.dispatched_calls; |
tmp = tmp->next) { |
call = list_get_instance(tmp, call_t, link); |
/branches/tracing/kernel/generic/src/ipc/sysipc.c |
---|
169,7 → 169,7 |
/* In case of forward, hangup the forwared phone, |
* not the originator |
*/ |
mutex_lock(&answer->data.phone->lock); |
spinlock_lock(&answer->data.phone->lock); |
spinlock_lock(&TASK->answerbox.lock); |
if (answer->data.phone->state == IPC_PHONE_CONNECTED) { |
list_remove(&answer->data.phone->link); |
176,7 → 176,7 |
answer->data.phone->state = IPC_PHONE_SLAMMED; |
} |
spinlock_unlock(&TASK->answerbox.lock); |
mutex_unlock(&answer->data.phone->lock); |
spinlock_unlock(&answer->data.phone->lock); |
} |
if (!olddata) |
/branches/tracing/kernel/generic/src/lib/rd.c |
---|
42,6 → 42,7 |
#include <mm/frame.h> |
#include <sysinfo/sysinfo.h> |
#include <ddi/ddi.h> |
#include <print.h> |
#include <align.h> |
static parea_t rd_parea; /**< Physical memory area for rd. */ |
51,7 → 52,7 |
* and information about the share is provided as sysinfo values to the userspace |
* tasks. |
*/ |
int init_rd(rd_header_t *header, size_t size) |
int init_rd(rd_header * header, size_t size) |
{ |
/* Identify RAM disk */ |
if ((header->magic[0] != RD_MAG0) || (header->magic[1] != RD_MAG1) || |
79,7 → 80,10 |
if ((hsize % FRAME_SIZE) || (dsize % FRAME_SIZE)) |
return RE_UNSUPPORTED; |
if (dsize % FRAME_SIZE) |
return RE_UNSUPPORTED; |
if (hsize > size) |
return RE_INVALID; |
/branches/tracing/kernel/generic/src/main/kinit.c |
---|
178,7 → 178,7 |
if (!ipc_phone_0) |
ipc_phone_0 = &utask->answerbox; |
} else { |
int rd = init_rd((rd_header_t *) init.tasks[i].addr, |
int rd = init_rd((rd_header *) init.tasks[i].addr, |
init.tasks[i].size); |
if (rd != RE_OK) |
/branches/tracing/kernel/generic/include/ipc/ipc.h |
---|
211,8 → 211,6 |
#define IPC_MAX_PHONES 16 |
#include <synch/spinlock.h> |
#include <synch/mutex.h> |
#include <synch/waitq.h> |
struct answerbox; |
233,7 → 231,7 |
/** Structure identifying phone (in TASK structure) */ |
typedef struct { |
mutex_t lock; |
SPINLOCK_DECLARE(lock); |
link_t link; |
struct answerbox *callee; |
ipc_phone_state_t state; |
/branches/tracing/kernel/generic/include/lib/rd.h |
---|
66,18 → 66,16 |
#define RE_UNSUPPORTED 2 /* Non-supported image (e.g. wrong version) */ |
/** RAM disk header */ |
struct rd_header { |
typedef struct { |
uint8_t magic[RD_MAGIC_SIZE]; |
uint8_t version; |
uint8_t data_type; |
uint32_t header_size; |
uint64_t data_size; |
} __attribute__ ((packed)); |
} rd_header; |
typedef struct rd_header rd_header_t; |
extern int init_rd(rd_header * addr, size_t size); |
extern int init_rd(rd_header_t *addr, size_t size); |
#endif |
/** @} |
/branches/tracing/kernel/arch/amd64/include/memstr.h |
---|
88,7 → 88,7 |
"movq %3, %0\n\t" |
"addq $1, %0\n\t" |
"1:\n" |
: "=a" (ret), "=&S" (d0), "=&D" (d1), "=&c" (d2) |
: "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2) |
: "0" (0), "1" (src), "2" (dst), "3" ((unative_t)cnt) |
); |
110,7 → 110,7 |
asm volatile ( |
"rep stosw\n\t" |
: "=&D" (d0), "=&c" (d1), "=&a" (x) |
: "=&D" (d0), "=&c" (d1), "=a" (x) |
: "0" (dst), "1" ((unative_t)cnt), "2" (x) |
: "memory" |
); |
132,7 → 132,7 |
asm volatile ( |
"rep stosb\n\t" |
: "=&D" (d0), "=&c" (d1), "=&a" (x) |
: "=&D" (d0), "=&c" (d1), "=a" (x) |
: "0" (dst), "1" ((unative_t)cnt), "2" (x) |
: "memory" |
); |
/branches/tracing/kernel/arch/mips32/include/atomic.h |
---|
63,7 → 63,7 |
" sc %0, %1\n" |
" beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ |
" nop\n" |
: "=&r" (tmp), "=m" (val->count), "=&r" (v) |
: "=r" (tmp), "=m" (val->count), "=r" (v) |
: "i" (i), "i" (0) |
); |
/branches/tracing/kernel/arch/ia32/include/memstr.h |
---|
94,7 → 94,7 |
"movl %3, %0\n\t" |
"addl $1, %0\n\t" |
"1:\n" |
: "=a" (ret), "=&S" (d0), "=&D" (d1), "=&c" (d2) |
: "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2) |
: "0" (0), "1" ((unative_t) src), "2" ((unative_t) dst), "3" ((unative_t) cnt) |
); |
116,7 → 116,7 |
asm volatile ( |
"rep stosw\n\t" |
: "=&D" (d0), "=&c" (d1), "=&a" (x) |
: "=&D" (d0), "=&c" (d1), "=a" (x) |
: "0" (dst), "1" (cnt), "2" (x) |
: "memory" |
); |
138,7 → 138,7 |
asm volatile ( |
"rep stosb\n\t" |
: "=&D" (d0), "=&c" (d1), "=&a" (x) |
: "=&D" (d0), "=&c" (d1), "=a" (x) |
: "0" (dst), "1" (cnt), "2" (x) |
: "memory" |
); |
/branches/tracing/uspace/lib/libc/arch/mips32/include/atomic.h |
---|
64,7 → 64,7 |
" sc %0, %1\n" |
" beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ |
/* nop */ /* nop is inserted automatically by compiler */ |
: "=&r" (tmp), "=m" (val->count), "=&r" (v) |
: "=r" (tmp), "=m" (val->count), "=r" (v) |
: "i" (i), "i" (0) |
); |
/branches/tracing/uspace/srv/pci/update-ids |
---|
2,14 → 2,15 |
wget http://pciids.sourceforge.net/v2.2/pci.ids |
cat > pci_ids.h <<EOF |
cat >pci_ids.h <<EOF |
/* DO NOT EDIT, THIS FILE IS AUTOMATICALLY GENERATED */ |
char *pci_ids[] = { |
EOF |
cat pci.ids | grep -v '^#.*' | grep -v '^$' | tr \" \' | sed -n 's/\(.*\)/"\1",/p' >> pci_ids.h |
cat pci.ids | grep -v '^#.*' | grep -v '^$' | tr \" \' | sed -n 's/\(.*\)/"\1",/p' >>pci_ids.h |
cat >> pci_ids.h <<EOF |
cat >>pci_ids.h <<EOF |
"" |
}; |
EOF |
/branches/tracing/boot/arch/mips32/loader/_link.ld.in.ecoff |
---|
File deleted |
/branches/tracing/boot/arch/mips32/loader/_link.ld.in.binary |
---|
File deleted |
/branches/tracing/boot/arch/mips32/loader/Makefile |
---|
32,14 → 32,6 |
## Toolchain configuration |
# |
ifeq ($(IMAGE),binary) |
LD_IN = binary |
endif |
ifeq ($(IMAGE),ecoff) |
LD_IN = ecoff |
endif |
BFD_NAME = elf32-tradlittlemips |
BFD_ARCH = mips |
TARGET = mipsel-linux-gnu |
TOOLCHAIN_DIR = /usr/local/mipsel/bin |
51,6 → 43,14 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
72,7 → 72,6 |
SOURCES = \ |
main.c \ |
msim.c \ |
_components.c \ |
../../../generic/printf.c \ |
asm.S \ |
boot.S |
110,14 → 109,11 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld _link.ld.in $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
_link.ld.in: _link.ld.in.$(LD_IN) |
cp $< $@ |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/tracing/boot/arch/mips32/loader/main.c |
---|
59,10 → 59,9 |
version_print(); |
component_t components[COMPONENTS]; |
bootinfo_t bootinfo; |
init_components(components); |
bootinfo_t bootinfo; |
printf("\nMemory statistics\n"); |
printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
printf(" %L: boot info structure\n", &bootinfo); |
/branches/tracing/boot/arch/mips32/loader/pack |
---|
0,0 → 1,126 |
#! /bin/sh |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
[ "$#" -lt 1 ] && exit 1 |
case "$1" in |
"binary") |
BFD="binary" |
;; |
"ecoff") |
BFD="ecoff-littlemips" |
;; |
*) |
echo "Undefined image format" >&1 |
exit 1 |
;; |
esac |
OBJCOPY="$2" |
LINK="_link.ld" |
HEADER="_components.h" |
shift 2 |
echo "OUTPUT_FORMAT(\"${BFD}\") |
ENTRY(start) |
SECTIONS { |
.boot 0xbfc00000: AT (0) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.scommon); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
*(.reginfo);" > "$LINK" |
echo '#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
typedef struct { |
char *name; |
void *start; |
void *end; |
unsigned int size; |
} component_t;' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
. = ALIGN(4096); |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned int) ${MACRO}_END - (unsigned int) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf32-tradlittlemips -B mips --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo ' } |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
static void init_components(component_t components[]) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/arch/sparc64/loader/_link.ld.in |
---|
File deleted |
/branches/tracing/boot/arch/sparc64/loader/Makefile |
---|
32,8 → 32,6 |
## Toolchain configuration |
# |
BFD_NAME = elf64-sparc |
BFD_ARCH = sparc |
TARGET = sparc64-linux-gnu |
TOOLCHAIN_DIR = /usr/local/sparc64/bin |
45,6 → 43,14 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
65,7 → 71,6 |
SOURCES = \ |
main.c \ |
_components.c \ |
../../../generic/printf.c \ |
../../../generic/string.c \ |
../../../genarch/balloc.c \ |
107,10 → 112,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot boot.disasm Makefile.depend |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
119,4 → 124,4 |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
disasm: image.boot |
$(OBJDUMP) -d image.boot > image.disasm |
$(OBJDUMP) -d image.boot > boot.disasm |
/branches/tracing/boot/arch/sparc64/loader/pack |
---|
0,0 → 1,113 |
#! /bin/sh |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
[ "$#" -lt 1 ] && exit 1 |
OBJCOPY="$1" |
LINK="_link.ld" |
HEADER="_components.h" |
shift |
echo 'OUTPUT_FORMAT("elf64-sparc") |
ENTRY(start) |
SECTIONS { |
.boot 0x4000: AT (0x4000) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON);' > "$LINK" |
echo '#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
typedef struct { |
char *name; |
void *start; |
void *end; |
unsigned int size; |
} component_t;' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned long) ${MACRO}_END - (unsigned long) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf64-sparc -B sparc --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo ' } |
/DISCARD/ : { |
*(.comment); |
*(.note*); |
} |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
static void init_components(component_t components[]) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/arch/ia64/loader/_link.ld.in |
---|
File deleted |
/branches/tracing/boot/arch/ia64/loader/Makefile |
---|
32,8 → 32,6 |
## Toolchain configuration |
# |
BFD_NAME = elf64-ia64-little |
BFD_ARCH = ia64 |
TARGET = ia64-pc-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ia64/bin |
79,7 → 77,6 |
../../../generic/printf.c \ |
../../../generic/string.c \ |
../../../genarch/balloc.c \ |
_components.c \ |
asm.S \ |
boot.S |
99,6 → 96,7 |
$(USPACEDIR)/app/tester/tester \ |
$(USPACEDIR)/app/klog/klog |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
108,6 → 106,7 |
-include Makefile.depend |
hello.efi: image.boot |
make -C gefi/HelenOS PREFIX=$(GEFI_PREFIX) |
cp gefi/HelenOS/hello.efi ../../../../ |
115,17 → 114,17 |
cp gefi/HelenOS/image.bin ../../../../ |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
$(LD) -Map boot.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
depend: |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot boot.disasm Makefile.depend |
make -C gefi/HelenOS clean |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned long" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
134,4 → 133,4 |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
disasm: image.boot |
$(OBJDUMP) -d image.boot > image.disasm |
$(OBJDUMP) -d image.boot > boot.disasm |
/branches/tracing/boot/arch/ia64/loader/pack |
---|
0,0 → 1,121 |
#! /bin/sh |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
[ "$#" -lt 1 ] && exit 1 |
OBJCOPY="$1" |
LINK="_link.ld" |
HEADER="_components.h" |
shift |
echo 'OUTPUT_FORMAT("elf64-ia64-little") |
ENTRY(start) |
SECTIONS { |
.boot 0x4400000: AT (0x4400000) { |
*(BOOTSTRAP); |
. = ALIGN (0x4000); |
' > "$LINK" |
echo '#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
typedef struct { |
char *name; |
void *start; |
void *end; |
unsigned int size; |
} component_t;' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
*(.${BASENAME}_image); |
. = ALIGN (0x4000);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned long) ${MACRO}_END - (unsigned long) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf64-ia64-little -B ia64 --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo ' |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
_got = . ; |
*(.got .got.*); |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON);' >> "$LINK" |
echo ' } |
/DISCARD/ : { |
*(.comment); |
*(.note*); |
} |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
static void init_components(component_t components[]) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/arch/arm32/loader/_link.ld.in |
---|
File deleted |
/branches/tracing/boot/arch/arm32/loader/Makefile |
---|
27,25 → 27,21 |
# |
include ../../../../version |
include ../../../Makefile.config |
include ../../../../Makefile.config |
## Toolchain configuration |
# |
BFD_NAME = elf32-littlearm |
BFD_ARCH = arm |
TARGET = arm-linux-gnu |
TOOLCHAIN_DIR = /usr/local/arm/bin |
ifeq ($(COMPILER),gcc_native) |
ifeq ($(COMPILER),native) |
CC = gcc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
else |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
72,27 → 68,29 |
boot.S \ |
asm.S \ |
mm.c \ |
print/gxemul.c \ |
_components.c \ |
../../../generic/printf.c \ |
../../../genarch/division.c |
ifeq ($(MACHINE), gxemul_testarm) |
SOURCES += print/gxemul.c |
endif |
COMPONENTS = \ |
$(KERNELDIR)/kernel.bin \ |
$(USPACEDIR)/srv/ns/ns \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/kbd/kbd \ |
$(USPACEDIR)/srv/console/console \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/vfs/vfs \ |
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
$(USPACEDIR)/srv/fs/fat/fat \ |
$(USPACEDIR)/srv/devmap/devmap \ |
$(USPACEDIR)/app/init/init \ |
$(USPACEDIR)/app/tetris/tetris \ |
$(USPACEDIR)/app/tester/tester \ |
$(USPACEDIR)/app/tetris/tetris \ |
$(USPACEDIR)/app/klog/klog \ |
$(USPACEDIR)/app/sctrace/sctrace \ |
$(USPACEDIR)/app/klog/klog |
$(USPACEDIR)/app/tetris/tetris |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
103,17 → 101,17 |
-include Makefile.depend |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
image.boot: depend _components.h _link.ld $(OBJECTS) $(COMPONENT_OBJECTS) |
$(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
depend: |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(IMAGE) $(OBJCOPY) $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/tracing/boot/arch/arm32/loader/pack |
---|
0,0 → 1,139 |
#! /bin/sh |
# |
# Copyright (C) 2007 Michal Kebrt |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
OBJCOPY="$1" |
LINK="_link.ld" |
HEADER="_components.h" |
shift 1 |
echo "OUTPUT_FORMAT(\"elf32-littlearm\") |
ENTRY(start) |
SECTIONS { |
.boot 0x0: AT (0) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.scommon); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
*(.reginfo); |
. = 0x4000; |
*(PT); /* page table placed at 0x4000 */" > "$LINK" |
echo ' |
/** @addtogroup arm32boot |
* @{ |
*/ |
/** @file |
* @brief Components (kernel + tasks) related declarations. |
* |
* Generated by the <code>pack</code> script. This script packs all the |
* components (kernel + tasks) into one image (image.boot) and generates |
* a code that initializes an array of #component_t structs. |
*/ |
#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
/** Holds information about components packed to one image (kernel + tasks). */ |
typedef struct { |
/** Name. */ |
char *name; |
/** Start address. */ |
void *start; |
/** End address. */ |
void *end; |
/** Size (in bytes). */ |
unsigned int size; |
} component_t; |
/** @} |
*/ |
' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
. = ALIGN(4096); |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned int) ${MACRO}_END - (unsigned int) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf32-littlearm -B arm --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo ' } |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
/** Initializes array of components. */ |
static void init_components(component_t components[]) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/arch/arm32/loader/main.c |
---|
76,10 → 76,9 |
version_print(); |
component_t components[COMPONENTS]; |
bootinfo_t bootinfo; |
init_components(components); |
bootinfo_t bootinfo; |
printf("\nMemory statistics\n"); |
printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
printf(" %L: boot info structure\n", &bootinfo); |
/branches/tracing/boot/arch/ppc32/loader/_link.ld.in |
---|
File deleted |
/branches/tracing/boot/arch/ppc32/loader/Makefile |
---|
32,8 → 32,6 |
## Toolchain configuration |
# |
BFD_NAME = elf32-powerpc |
BFD_ARCH = powerpc:common |
TARGET = ppc-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ppc/bin |
45,6 → 43,14 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
66,7 → 72,6 |
SOURCES = \ |
main.c \ |
ofwarch.c \ |
_components.c \ |
../../../genarch/ofw.c \ |
../../../generic/printf.c \ |
asm.S \ |
104,10 → 109,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(OBJCOPY) $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/tracing/boot/arch/ppc32/loader/main.c |
---|
96,10 → 96,10 |
{ |
version_print(); |
component_t components[COMPONENTS]; |
init_components(components); |
init_components(); |
unsigned int i; |
for (i = 0; i < COMPONENTS; i++) |
check_align(components[i].start, components[i].name); |
/branches/tracing/boot/arch/ppc32/loader/pack |
---|
0,0 → 1,115 |
#! /bin/sh |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
[ "$#" -lt 1 ] && exit 1 |
OBJCOPY="$1" |
LINK="_link.ld" |
HEADER="_components.h" |
shift |
echo 'OUTPUT_FORMAT("elf32-powerpc") |
OUTPUT_ARCH(powerpc:common) |
ENTRY(start) |
SECTIONS { |
.boot 0x10000000: AT (0) { |
*(BOOTSTRAP); |
*(REALMODE); |
*(.text); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */' > "$LINK" |
echo '#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
typedef struct { |
char *name; |
void *start; |
void *end; |
unsigned int size; |
} component_t;' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
. = ALIGN(4096); |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned int) ${MACRO}_END - (unsigned int) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf32-powerpc -B powerpc:common --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo ' } |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
component_t components[COMPONENTS]; |
static void init_components(void) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/arch/ppc64/loader/_link.ld.in |
---|
File deleted |
/branches/tracing/boot/arch/ppc64/loader/Makefile |
---|
32,8 → 32,6 |
## Toolchain configuration |
# |
BFD_NAME = elf64-powerpc |
BFD_ARCH = powerpc:common64 |
TARGET = ppc64-linux-gnu |
TOOLCHAIN_DIR = /usr/local/ppc64/bin |
45,6 → 43,14 |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
OBJCOPY = objcopy |
OBJDUMP = objdump |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
66,7 → 72,6 |
SOURCES = \ |
main.c \ |
ofwarch.c \ |
_components.c \ |
../../../genarch/ofw.c \ |
../../../generic/printf.c \ |
asm.S \ |
104,10 → 109,10 |
-makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
-rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned long" $(COMPONENTS) |
_components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
./pack $(OBJCOPY) $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/tracing/boot/arch/ppc64/loader/main.c |
---|
96,9 → 96,8 |
{ |
version_print(); |
component_t components[COMPONENTS]; |
init_components(components); |
init_components(); |
unsigned int i; |
for (i = 0; i < COMPONENTS; i++) |
/branches/tracing/boot/arch/ppc64/loader/pack |
---|
0,0 → 1,124 |
#! /bin/sh |
# |
# Copyright (C) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - Redistributions in binary form must reproduce the above copyright |
# notice, this list of conditions and the following disclaimer in the |
# documentation and/or other materials provided with the distribution. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
[ "$#" -lt 1 ] && exit 1 |
OBJCOPY="$1" |
LINK="_link.ld" |
HEADER="_components.h" |
shift |
echo 'OUTPUT_FORMAT("elf64-powerpc") |
OUTPUT_ARCH(powerpc:common64) |
ENTRY(start) |
SECTIONS { |
.boot 0x0000000010000000: AT (0) { |
*(BOOTSTRAP); |
*(REALMODE); |
*(.text); |
*(.toc); |
*(.opd); |
*(.rodata); |
*(.rodata.*); |
*(.data); /* initialized data */ |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); /* global variables */ |
. = ALIGN(4096); |
*(.kernel_image);' > "$LINK" |
echo '#ifndef ___COMPONENTS_H__ |
#define ___COMPONENTS_H__ |
typedef struct { |
char *name; |
void *start; |
void *end; |
unsigned long size; |
} component_t;' > "$HEADER" |
COUNT="0" |
DATA="" |
for TASK in "$@" ; do |
BASENAME="`basename "$TASK" | sed 's/^\(.*\)\.[^.]*$/\1/'`" |
OBJECT="${BASENAME}.o" |
SYMBOL="`echo "_binary_$TASK" | tr "./" "__"`" |
MACRO="`echo "$BASENAME" | tr [:lower:] [:upper:]`" |
echo "$TASK -> $OBJECT" |
echo " |
. = ALIGN(4096); |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
extern int ${SYMBOL}_start; |
extern int ${SYMBOL}_end; |
#define ${MACRO}_START ((void *) &${SYMBOL}_start) |
#define ${MACRO}_END ((void *) &${SYMBOL}_end) |
#define ${MACRO}_SIZE ((unsigned long) ${MACRO}_END - (unsigned long) ${MACRO}_START)" >> "$HEADER" |
"$OBJCOPY" -I binary -O elf64-powerpc -B powerpc:common64 --rename-section ".data=.${BASENAME}_image" "$TASK" "$OBJECT" |
DATA="${DATA} |
components[$COUNT].name = \"${BASENAME}\"; |
components[$COUNT].start = ${MACRO}_START; |
components[$COUNT].end = ${MACRO}_END; |
components[$COUNT].size = ${MACRO}_SIZE;"; |
COUNT="`expr "$COUNT" + 1`" |
done |
echo '} |
/DISCARD/ : { |
*(*); |
} |
}' >> "$LINK" |
echo " |
#define COMPONENTS $COUNT |
component_t components[COMPONENTS]; |
static void init_components(void) |
{ |
$DATA |
} |
#endif |
" >> "$HEADER" |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/branches/tracing/boot/tools/pack.py |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/tracing/tools/fix_symlinks.sh |
---|
File deleted |
/branches/tracing/tools/mktmpfs.py |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/branches/tracing/tools/config.py |
---|
1,6 → 1,6 |
#!/usr/bin/env python |
# |
# Copyright (c) 2006 Ondrej Palkovsky |
# Copyright (c) 2006 Ondrej Palkovsky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
/branches/tracing/tools/cygwin_symlink_patch.sh |
---|
0,0 → 1,22 |
# by Alf |
# This script solves malfunction of symlinks in cygwin |
# |
# Download sources from repository and than run this script to correct symlinks |
# to be able compile project |
if uname | grep 'CYGWIN' > /dev/null; then |
echo "Good ... you have cygwin" |
else |
echo "Wrong. This script is only for cygwin" |
exit |
fi |
for linkName in `find . ! -iwholename '.*svn*' ! -type d -print`; do |
if head -n 1 $linkName | grep '^link' > /dev/null; then |
linkTarget=`head -n 1 $linkName | sed 's/^link //'` |
echo $linkName " -->" $linkTarget |
rm $linkName |
ln -s "$linkTarget" "$linkName" |
fi |
done |
/branches/tracing/HelenOS.config |
---|
44,7 → 44,7 |
@ "msim" MSIM |
@ "simics" Simics |
@ "bgxemul" GXEmul big endian |
@ "lgxemul" GXEmul little endian |
@ "lgxemul" GXEmul little endia |
@ "indy" Sgi Indy |
! [PLATFORM=mips32] MACHINE (choice) |