Changeset 37b1651d in mainline
- Timestamp:
- 2011-03-02T11:53:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- af430ce, e135751
- Parents:
- 4c7c251 (diff), 3f7efa79 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r4c7c251 r37b1651d 42 42 CONFIG_HEADER = config.h 43 43 44 .PHONY: all precheck cscope autotool config_auto config_default config distclean clean check 44 .PHONY: all precheck cscope autotool config_auto config_default config distclean clean check distfile dist 45 45 46 46 all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) … … 64 64 endif 65 65 66 # Autotool (detects compiler features) 67 66 68 $(COMMON_MAKEFILE): autotool 67 69 $(COMMON_HEADER): autotool … … 70 72 $(AUTOTOOL) 71 73 -[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER) 74 75 # Build-time configuration 72 76 73 77 $(CONFIG_MAKEFILE): config_default … … 84 88 $(CONFIG) $< 85 89 90 # Distribution files 91 92 distfile: all 93 $(MAKE) -C dist distfile 94 95 dist: 96 $(MAKE) -C dist dist 97 98 # Cleaning 99 86 100 distclean: clean 87 rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc 101 rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc dist/HelenOS-* 88 102 89 103 clean: -
boot/arch/sparc64/include/arch.h
r4c7c251 r37b1651d 41 41 #define STACK_BIAS 2047 42 42 #define STACK_WINDOW_SAVE_AREA_SIZE (16 * 8) 43 #define STACK_ARG_SAVE_AREA_SIZE (6 * 8) 43 44 44 45 #define NWINDOWS 8 -
boot/arch/sparc64/src/asm.S
r4c7c251 r37b1651d 152 152 .global ofw 153 153 ofw: 154 save %sp, - STACK_WINDOW_SAVE_AREA_SIZE, %sp154 save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp 155 155 set ofw_cif, %l0 156 156 ldx [%l0], %l0 -
boot/arch/sparc64/src/main.c
r4c7c251 r37b1651d 190 190 bootinfo.memmap.zones[0].start += OBP_BIAS; 191 191 bootinfo.memmap.zones[0].size -= OBP_BIAS; 192 bootinfo.memmap.total -= OBP_BIAS; 192 193 } 193 194 … … 204 205 bootinfo.physmem_start = ofw_get_physmem_start(); 205 206 ofw_memmap(&bootinfo.memmap); 207 208 if (arch == ARCH_SUN4V) 209 sun4v_fixups(); 206 210 207 211 void *bootinfo_pa = ofw_translate(&bootinfo); … … 253 257 254 258 /* 255 * At this point, we claim the physical memory that we are256 * going to use. We should be safe in case of the virtual259 * At this point, we claim and map the physical memory that we 260 * are going to use. We should be safe in case of the virtual 257 261 * address space because the OpenFirmware, according to its 258 * SPARC binding, should restrict its use of virtual memory 259 * to addresses from [0xffd00000; 0xffefffff] and 260 * [0xfe000000; 0xfeffffff]. 261 * 262 * We don't map this piece of memory. We simply rely on 263 * SILO to have it done for us already in this case. 264 * 265 * XXX SILO only maps 8 MB for us here. We should improve 266 * this code to be totally independent on the behavior 267 * of SILO. 268 * 262 * SPARC binding, should restrict its use of virtual memory to 263 * addresses from [0xffd00000; 0xffefffff] and [0xfe000000; 264 * 0xfeffffff]. 269 265 */ 270 266 ofw_claim_phys(bootinfo.physmem_start + dest[i - 1], 271 267 ALIGN_UP(components[i - 1].inflated, PAGE_SIZE)); 268 269 ofw_map(bootinfo.physmem_start + dest[i - 1], dest[i - 1], 270 ALIGN_UP(components[i - 1].inflated, PAGE_SIZE), -1); 272 271 273 272 int err = inflate(components[i - 1].start, components[i - 1].size, … … 304 303 sun4u_smp(); 305 304 306 if (arch == ARCH_SUN4V)307 sun4v_fixups();308 309 305 printf("Booting the kernel ...\n"); 310 306 jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, subarch, -
boot/generic/src/balloc.c
r4c7c251 r37b1651d 65 65 void *balloc_rebase(void *ptr) 66 66 { 67 return (void *) (( uintptr_t) ptr - phys_base+ ballocs->base);67 return (void *) (((uintptr_t) ptr - phys_base) + ballocs->base); 68 68 } -
kernel/arch/sparc64/src/sun4v/asm.S
r4c7c251 r37b1651d 41 41 .global switch_to_userspace 42 42 switch_to_userspace: 43 wrpr PSTATE_PRIV_BIT, %pstate 44 save %o1, -STACK_WINDOW_SAVE_AREA_SIZE, %sp 43 save %o1, -(STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE), %sp 45 44 flushw 46 45 wrpr %g0, 0, %cleanwin ! avoid information leak -
tools/toolchain.sh
r4c7c251 r37b1651d 28 28 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 # 30 31 GMP_MAIN=<<EOF 32 #define GCC_GMP_VERSION_NUM(a, b, c) \ 33 (((a) << 16L) | ((b) << 8) | (c)) 34 35 #define GCC_GMP_VERSION \ 36 GCC_GMP_VERSION_NUM(__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL) 37 38 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2) 39 choke me 40 #endif 41 EOF 42 43 MPFR_MAIN=<<EOF 44 #if MPFR_VERSION < MPFR_VERSION_NUM(2, 4, 2) 45 choke me 46 #endif 47 EOF 48 49 MPC_MAIN=<<EOF 50 #if MPC_VERSION < MPC_VERSION_NUM(0, 8, 1) 51 choke me 52 #endif 53 EOF 54 55 # 56 # Check if the library described in the argument 57 # exists and has acceptable version. 58 # 59 check_dependency() { 60 DEPENDENCY="$1" 61 HEADER="$2" 62 BODY="$3" 63 64 FNAME="/tmp/conftest-$$" 65 66 echo "#include ${HEADER}" > "${FNAME}.c" 67 echo >> "${FNAME}.c" 68 echo "int main()" >> "${FNAME}.c" 69 echo "{" >> "${FNAME}.c" 70 echo "${BODY}" >> "${FNAME}.c" 71 echo " return 0;" >> "${FNAME}.c" 72 echo "}" >> "${FNAME}.c" 73 74 cc -c -o "${FNAME}.o" "${FNAME}.c" 2> "${FNAME}.log" 75 RC="$?" 76 77 if [ "$RC" -ne "0" ] ; then 78 echo " ${DEPENDENCY} not found, too old or compiler error." 79 echo " Please recheck manually the source file \"${FNAME}.c\"." 80 echo " The compilation of the toolchain is probably going to fail," 81 echo " you have been warned." 82 echo 83 echo " ===== Compiler output =====" 84 cat "${FNAME}.log" 85 echo " ===========================" 86 echo 87 else 88 echo " ${DEPENDENCY} found" 89 rm -f "${FNAME}.log" "${FNAME}.o" "${FNAME}.c" 90 fi 91 } 92 93 check_dependecies() { 94 echo ">>> Basic dependency check" 95 check_dependency "GMP" "<gmp.h>" "${GMP_MAIN}" 96 check_dependency "MPFR" "<mpfr.h>" "${MPFR_MAIN}" 97 check_dependency "MPC" "<mpc.h>" "${MPC_MAIN}" 98 echo 99 } 30 100 31 101 check_error() { … … 69 139 echo " sparc64 SPARC V9" 70 140 echo " all build all targets" 141 echo 142 echo "The toolchain will be installed to the directory specified by" 143 echo "the CROSS_PREFIX environment variable. If the variable is not" 144 echo "defined, /usr/local will be used by default." 71 145 echo 72 146 … … 118 192 echo " - native C library with headers" 119 193 echo 120 121 show_countdown 10122 194 } 123 195 … … 281 353 282 354 show_dependencies 355 check_dependecies 356 show_countdown 10 283 357 284 358 case "$1" in -
uspace/app/bdsh/cmds/modules/mount/mount.c
r4c7c251 r37b1651d 31 31 #include <vfs/vfs.h> 32 32 #include <errno.h> 33 #include <getopt.h> 33 34 #include "config.h" 34 35 #include "util.h" … … 40 41 static const char *cmdname = "mount"; 41 42 42 /* Dispays help for mount in various levels */ 43 static struct option const long_options[] = { 44 { "help", no_argument, 0, 'h' }, 45 { 0, 0, 0, 0 } 46 }; 47 48 49 /* Displays help for mount in various levels */ 43 50 void help_cmd_mount(unsigned int level) 44 51 { … … 59 66 unsigned int argc; 60 67 const char *mopts = ""; 61 int rc ;68 int rc, c, opt_ind; 62 69 63 70 argc = cli_count_args(argv); 64 71 72 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 73 c = getopt_long(argc, argv, "h", long_options, &opt_ind); 74 switch (c) { 75 case 'h': 76 help_cmd_mount(HELP_LONG); 77 return CMD_SUCCESS; 78 } 79 } 80 65 81 if ((argc < 4) || (argc > 5)) { 66 printf("%s: invalid number of arguments. \n",82 printf("%s: invalid number of arguments. Try `mount --help'\n", 67 83 cmdname); 68 84 return CMD_FAILURE; -
uspace/lib/c/generic/loader.c
r4c7c251 r37b1651d 160 160 int rc = async_data_write_start(ldr->phone_id, (void *) pa, pa_len); 161 161 if (rc != EOK) { 162 free(pa); 162 163 async_wait_for(req, NULL); 163 164 return rc; -
uspace/lib/c/generic/vfs/vfs.c
r4c7c251 r37b1651d 69 69 char *ncwd_path; 70 70 char *ncwd_path_nc; 71 size_t total_size; 71 72 72 73 fibril_mutex_lock(&cwd_mutex); … … 77 78 return NULL; 78 79 } 79 ncwd_path_nc = malloc(cwd_size + 1 + size + 1); 80 total_size = cwd_size + 1 + size + 1; 81 ncwd_path_nc = malloc(total_size); 80 82 if (!ncwd_path_nc) { 81 83 fibril_mutex_unlock(&cwd_mutex); 82 84 return NULL; 83 85 } 84 str_cpy(ncwd_path_nc, cwd_size + 1 + size + 1, cwd_path);86 str_cpy(ncwd_path_nc, total_size, cwd_path); 85 87 ncwd_path_nc[cwd_size] = '/'; 86 88 ncwd_path_nc[cwd_size + 1] = '\0'; 87 89 } else { 88 ncwd_path_nc = malloc(size + 1); 90 total_size = size + 1; 91 ncwd_path_nc = malloc(total_size); 89 92 if (!ncwd_path_nc) { 90 93 fibril_mutex_unlock(&cwd_mutex); … … 93 96 ncwd_path_nc[0] = '\0'; 94 97 } 95 str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path);98 str_append(ncwd_path_nc, total_size, path); 96 99 ncwd_path = canonify(ncwd_path_nc, retlen); 97 100 if (!ncwd_path) { -
uspace/srv/devmap/devmap.c
r4c7c251 r37b1651d 123 123 static devmap_handle_t last_handle = 0; 124 124 static devmap_device_t *null_devices[NULL_DEVICES]; 125 126 /* 127 * Dummy list for null devices. This is necessary so that null devices can 128 * be used just as any other devices, e.g. in devmap_device_unregister_core(). 129 */ 130 static LIST_INITIALIZE(dummy_null_driver_devices); 125 131 126 132 static devmap_handle_t devmap_create_handle(void) … … 953 959 device->name = dev_name; 954 960 955 /* Insert device into list of all devices 956 and into null devices array */ 961 /* 962 * Insert device into list of all devices and into null devices array. 963 * Insert device into a dummy list of null driver's devices so that it 964 * can be safely removed later. 965 */ 957 966 list_append(&device->devices, &devices_list); 967 list_append(&device->driver_devices, &dummy_null_driver_devices); 958 968 null_devices[i] = device; 959 969 -
uspace/srv/fs/fat/fat_ops.c
r4c7c251 r37b1651d 325 325 uint16_t_le2host(d->firstc)); 326 326 if (rc != EOK) { 327 (void) block_put(b); 327 328 (void) fat_node_put(FS_NODE(nodep)); 328 329 return rc; … … 811 812 fibril_mutex_unlock(&childp->idx->lock); 812 813 childp->lnkcnt = 0; 814 childp->refcnt++; /* keep the node in memory until destroyed */ 813 815 childp->dirty = true; 814 816 fibril_mutex_unlock(&childp->lock); … … 1488 1490 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1489 1491 fs_node_t *fn; 1492 fat_node_t *nodep; 1490 1493 int rc; 1491 1494 … … 1499 1502 return; 1500 1503 } 1504 1505 nodep = FAT_NODE(fn); 1506 /* 1507 * We should have exactly two references. One for the above 1508 * call to fat_node_get() and one from fat_unlink(). 1509 */ 1510 assert(nodep->refcnt == 2); 1501 1511 1502 1512 rc = fat_destroy_node(fn);
Note:
See TracChangeset
for help on using the changeset viewer.