Changeset c1403ef1 in rtems for c/src/lib/libbsp/unix/posix/startup
- Timestamp:
- 08/11/95 14:30:27 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 4e58d80
- Parents:
- aa9f194
- Location:
- c/src/lib/libbsp/unix/posix/startup
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/unix/posix/startup/bspclean.c
raa9f194 rc1403ef1 23 23 #include <bsp.h> 24 24 25 #include <stdio.h> 26 25 27 /* 26 28 * The app has "exited" (called rtems_shutdown_executive) … … 34 36 */ 35 37 38 fflush(stdout); 39 fflush(stderr); 40 36 41 rtems_fatal_error_occurred(0); 37 42 } -
c/src/lib/libbsp/unix/posix/startup/bspstart.c
raa9f194 rc1403ef1 34 34 #include <fcntl.h> 35 35 #include <unistd.h> 36 #include <sys/stat.h>37 36 38 37 #include <bsp.h> … … 59 58 char **rtems_envp; 60 59 61 62 #define WORKSPACE_SIZE (WORKSPACE_MB * (1024 * 1024)) 63 #define HEAPSPACE_SIZE (HEAPSPACE_MB * (1024 * 1024)) 64 65 rtems_unsigned8 MY_WORK_SPACE[ WORKSPACE_SIZE ] CPU_STRUCTURE_ALIGNMENT; 60 /* 61 * May be overridden by RTEMS_WORKSPACE_SIZE and RTEMS_HEAPSPACE_SIZE 62 * environment variables; see below. 63 */ 64 65 #define DEFAULT_WORKSPACE_SIZE (WORKSPACE_MB * (1024 * 1024)) 66 #define DEFAULT_HEAPSPACE_SIZE (HEAPSPACE_MB * (1024 * 1024)) 66 67 67 68 /* … … 103 104 void *heap_start; 104 105 105 Heap_size = HEAPSPACE_SIZE; 106 if (getenv("RTEMS_HEAPSPACE_SIZE")) 107 Heap_size = strtol(getenv("RTEMS_HEAPSPACE_SIZE"), 0, 0); 108 else 109 Heap_size = DEFAULT_HEAPSPACE_SIZE; 110 106 111 heap_start = 0; 107 112 … … 186 191 bsp_start(void) 187 192 { 188 struct stat stat_buf; 189 char buf[256]; 190 char node[6]; 191 char *home; 192 int fd; 193 unsigned32 workspace_ptr; 193 194 194 195 /* … … 199 200 200 201 /* 201 * If the node number is -1 then the application better provide 202 * it through the file $HOME/rtems_node 203 */ 204 205 BSP_Multiprocessing.node = -1; 202 * If the node number is -1 then the application better provide 203 * it through environment variables RTEMS_NODE. 204 * Ditto for RTEMS_MAXIMUM_NODES 205 */ 206 206 207 207 if (BSP_Configuration.User_multiprocessing_table) { 208 if (BSP_Configuration.User_multiprocessing_table->node == -1) { 209 home = getenv("HOME"); 210 sprintf(buf, "%s/%s", home, "rtems_node"); 211 if ((stat(buf, &stat_buf)) == 0) { 212 fd = open(buf, O_RDONLY); 213 read(fd, node, 5); 214 close(fd); 215 unlink(buf); 216 BSP_Multiprocessing = *BSP_Configuration.User_multiprocessing_table; 217 BSP_Multiprocessing.node = atoi(node); 218 BSP_Configuration.User_multiprocessing_table = &BSP_Multiprocessing; 208 char *p; 209 210 /* make a copy for possible editing */ 211 BSP_Multiprocessing = *BSP_Configuration.User_multiprocessing_table; 212 BSP_Configuration.User_multiprocessing_table = &BSP_Multiprocessing; 213 214 if (BSP_Multiprocessing.node == -1) 215 { 216 p = getenv("RTEMS_NODE"); 217 BSP_Multiprocessing.node = p ? atoi(p) : 1; 219 218 } 220 if (BSP_Configuration.User_multiprocessing_table->maximum_nodes == -1) { 221 home = getenv("HOME"); 222 sprintf(buf, "%s/%s", home, "rtems_max_node"); 223 if ((stat(buf, &stat_buf)) == 0) { 224 fd = open(buf, O_RDONLY); 225 read(fd, node, 5); 226 close(fd); 227 BSP_Multiprocessing.maximum_nodes = atoi(node); 228 } 219 220 /* If needed provide maximum_nodes also */ 221 if (BSP_Multiprocessing.maximum_nodes == -1) 222 { 223 p = getenv("RTEMS_MAXIMUM_NODES"); 224 BSP_Multiprocessing.maximum_nodes = p ? atoi(p) : 1; 229 225 } 230 }231 226 } 232 227 … … 240 235 cpu_number = 0; 241 236 242 BSP_Configuration.work_space_start = (void *)MY_WORK_SPACE; 243 if (BSP_Configuration.work_space_size) 244 BSP_Configuration.work_space_size = WORKSPACE_SIZE; 245 237 if (getenv("RTEMS_WORKSPACE_SIZE")) 238 BSP_Configuration.work_space_size = 239 strtol(getenv("RTEMS_WORKSPACE_SIZE"), 0, 0); 240 else 241 BSP_Configuration.work_space_size = DEFAULT_WORKSPACE_SIZE; 242 243 /* 244 * Allocate workspace memory, ensuring it is properly aligned 245 */ 246 247 workspace_ptr = 248 (unsigned32) sbrk(BSP_Configuration.work_space_size + CPU_ALIGNMENT); 249 workspace_ptr += CPU_ALIGNMENT - 1; 250 workspace_ptr &= ~(CPU_ALIGNMENT - 1); 251 252 BSP_Configuration.work_space_start = (void *) workspace_ptr; 253 246 254 /* 247 255 * Set up our hooks -
c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc
raa9f194 rc1403ef1 1 1 // @(#)rtems-ctor.cc 1.6 - 95/04/25 2 // 2 // 3 3 // 4 4 … … 7 7 * 8 8 * Description: 9 * 9 * This file exists solely to (try to) ensure RTEMS is initialized 10 10 * before any global constructors are run. 11 11 * … … 50 50 51 51 #include <bsp.h> 52 #include <stdio.h> 53 #include <stdlib.h> 52 54 53 55 /* … … 62 64 class RTEMS { 63 65 public: 64 66 RTEMS(); 65 67 ~RTEMS(); 66 68 }; … … 84 86 char **environp) 85 87 { 86 87 88 88 rtems_argc = argc; 89 rtems_argv = argv; 90 rtems_envp = environp; 89 91 90 92 if ((argc > 0) && argv && argv[0]) … … 104 106 */ 105 107 108 fflush( stdout ); 109 fflush( stderr ); 106 110 return 0; 107 111 } -
c/src/lib/libbsp/unix/posix/startup/setvec.c
raa9f194 rc1403ef1 38 38 */ 39 39 40 unix_isr_entry40 rtems_isr_entry 41 41 set_vector( /* returns old vector */ 42 42 rtems_isr_entry handler, /* isr routine */ … … 50 50 if ( type ) { 51 51 rtems_interrupt_catch( handler, vector, &rtems_isr_ptr ); 52 return (unix_isr_entry)rtems_isr_ptr;52 return rtems_isr_ptr; 53 53 } else { 54 54 _CPU_ISR_install_vector( vector, (proc_ptr) handler, &raw_isr_ptr ); 55 return (unix_isr_entry)raw_isr_ptr;55 return raw_isr_ptr; 56 56 } 57 57
Note: See TracChangeset
for help on using the changeset viewer.