/[rtmk]/rtmk/bootstrap.c
ViewVC logotype

Diff of /rtmk/bootstrap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by jrydberg, Tue Jan 29 18:31:45 2002 UTC revision 1.9 by jrydberg, Wed Feb 20 20:04:42 2002 UTC
# Line 1  Line 1 
1  /* ??? bootstrap related stuff.  /* Loading of the bootstrap process.
2     Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org.     Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@rtmk.org.
3    
4  This program is free software; you can redistribute it and/or modify  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
# Line 28  Foundation, Inc., 59 Temple Place - Suit Line 28  Foundation, Inc., 59 Temple Place - Suit
28  #include "host.h"  #include "host.h"
29    
30  /* Array of loaded modules.  */  /* Array of loaded modules.  */
   
31  struct bootstrap bootstrap_modules [MAX_BOOTSTRAP_MODULES];  struct bootstrap bootstrap_modules [MAX_BOOTSTRAP_MODULES];
32    
33  /* Number of loaded modules.  */  /* Number of loaded modules.  */
   
34  int bootstrap_count = 0;  int bootstrap_count = 0;
35    
36  /* Bootstrap task.  */  /* Bootstrap task.  */
   
37  static struct task *bootstrap_task;  static struct task *bootstrap_task;
38    
39  /* Function for reading SIZE bytes at OFFSET into buffer DST.  /* Function for reading SIZE bytes at OFFSET into buffer DST.
40     Number of bytes actual read returned in ACTUAL_SIZE.  */     Number of bytes actual read returned in ACTUAL_SIZE.  */
   
41  static int  static int
42  fmt_read_fn (void *handle, vm_offset_t offset, void *dst,  fmt_read_fn (void *handle, vm_offset_t offset, void *dst,
43               vm_size_t size, vm_size_t *actual_size)               vm_size_t size, vm_size_t *actual_size)
# Line 54  fmt_read_fn (void *handle, vm_offset_t o Line 50  fmt_read_fn (void *handle, vm_offset_t o
50  /* Function for writing FSIZE bytes from FOFFSET into virtual  /* Function for writing FSIZE bytes from FOFFSET into virtual
51     address VOFFSET.  Allocate VSIZE bytes for memory object.     address VOFFSET.  Allocate VSIZE bytes for memory object.
52     Memory protection is specified with PROTECTION.  */     Memory protection is specified with PROTECTION.  */
   
53  static int  static int
54  fmt_write_fn (void *handle, vm_offset_t foffset, vm_size_t fsize,  fmt_write_fn (void *handle, vm_offset_t foffset, vm_size_t fsize,
55                vm_offset_t voffset, vm_size_t vsize, vm_prot_t protection)                vm_offset_t voffset, vm_size_t vsize, vm_prot_t protection)
# Line 84  fmt_write_fn (void *handle, vm_offset_t Line 79  fmt_write_fn (void *handle, vm_offset_t
79  }  }
80    
81  /* Copy STR into user address space at STACK_PTR-LEN.  */  /* Copy STR into user address space at STACK_PTR-LEN.  */
   
82  static vm_offset_t  static vm_offset_t
83  copyoutstr (vm_offset_t stack_ptr, char *str, int len)  copyoutstr (vm_offset_t stack_ptr, char *str, int len)
84  {  {
# Line 101  copyoutstr (vm_offset_t stack_ptr, char Line 95  copyoutstr (vm_offset_t stack_ptr, char
95    
96  /* Build stack frame for user bootstrap thread.  STACK_TOP points to  /* Build stack frame for user bootstrap thread.  STACK_TOP points to
97     top of stack.  BOOTSTRAP_NAME will be split into several arguments.  */     top of stack.  BOOTSTRAP_NAME will be split into several arguments.  */
   
98  static vm_offset_t  static vm_offset_t
99  build_stack_frame (vm_offset_t stack_top, char *bootstrap_name,  build_stack_frame (vm_offset_t stack_top, char *bootstrap_name,
100                     char *fmt, ...)                     char *fmt, ...)
# Line 175  build_stack_frame (vm_offset_t stack_top Line 168  build_stack_frame (vm_offset_t stack_top
168  }  }
169    
170  /* "Bootstrap bootstrap" thread function.  ARG is unused.  */  /* "Bootstrap bootstrap" thread function.  ARG is unused.  */
   
171  static void  static void
172  bootstrap_thread_fn (void *arg)  bootstrap_thread_fn (void *arg)
173  {  {
# Line 242  bootstrap_thread_fn (void *arg) Line 234  bootstrap_thread_fn (void *arg)
234  }  }
235    
236  /* Initialize the bootstrap.  */  /* Initialize the bootstrap.  */
   
237  void  void
238  bootstrap_init (void)  bootstrap_init (void)
239  {  {
# Line 266  bootstrap_init (void) Line 257  bootstrap_init (void)
257        
258    thread_start (bootstrap_thread, bootstrap_thread_fn, 0);    thread_start (bootstrap_thread, bootstrap_thread_fn, 0);
259    thread_setrun (bootstrap_thread, false);    thread_setrun (bootstrap_thread, false);
   
   trace_printf ("should be able to run bootstrap thread");  
260  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26