Skip to content

Commit

Permalink
Harmony fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Mar 17, 2009
1 parent e0a140e commit e2d03c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions tools/bootloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,11 @@ static void* mapImageFile(const char *fileName, const void *targetAddress,
void *bootRegion = 0;
SYS_START();
TRACE_PRINTF("%s: mapImageFile \"%s\" to %p\n", Me, fileName, targetAddress);
/* TODO: respect access protection when mapping. Problems, need to
* write over memory for Harmony when reading from file.
*/
writable = JNI_TRUE;
executable = JNI_TRUE;
#ifdef RVM_FOR_HARMONY
IDATA fin = hyfile_open(fileName, HyOpenRead, 0);
if (fin < 0) {
Expand Down Expand Up @@ -534,9 +539,9 @@ static void* mapImageFile(const char *fileName, const void *targetAddress,
*roundedImageSize = pageRoundUp(actualImageSize);
fseek (fin, 0L, SEEK_SET);
int prot = PROT_READ;
if (1 || writable)
if (writable)
prot |= PROT_WRITE;
if (1 || executable)
if (executable)
prot |= PROT_EXEC;
bootRegion = mmap((void*)targetAddress, *roundedImageSize,
prot,
Expand Down Expand Up @@ -764,8 +769,8 @@ int main(int argc, const char **argv)

TRACE_PRINTF("\nRunBootImage.main(): VM variable settings\n");
TRACE_PRINTF("initialHeapSize %lu\nmaxHeapSize %lu\n"
"bootCodeFileName |%s|\nbootDataFileName |%s|\n"
"bootRmapFileName |%s|\n"
"bootCodeFileName \"%s\"\nbootDataFileName \"%s\"\n"
"bootRmapFileName \"%s\"\n"
"verbose %d\n",
(unsigned long) initialHeapSize,
(unsigned long) maximumHeapSize,
Expand Down
1 change: 1 addition & 0 deletions tools/bootloader/sysSignal.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ static void softwareSignalHandler(int signo, siginfo_t UNUSED *si, void *context
*/
EXTERNAL void* sysStartMainThreadSignals()
{
SYS_START();
/* install a stack for hardwareTrapHandler() to run on */
stack_t stack;
char *stackBuf;
Expand Down
2 changes: 1 addition & 1 deletion tools/bootloader/sysThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
*/

#include "sys.h"
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>

#ifndef RVM_FOR_HARMONY
#include <errno.h>
#include <pthread.h>
#include <setjmp.h>
#include <sys/sysinfo.h>
#include <sys/ucontext.h>
#endif
Expand Down

0 comments on commit e2d03c9

Please sign in to comment.