- Timestamp:
- 2011-09-24T14:20:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bf76c1
- Parents:
- 867e2555 (diff), 1ab4aca (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. - Location:
- boot
- Files:
-
- 6 added
- 8 edited
- 1 moved
-
Makefile (modified) (2 diffs)
-
Makefile.common (modified) (7 diffs)
-
arch/ia64/Makefile.inc (modified) (1 diff)
-
arch/ia64/include/pal.h (added)
-
arch/ia64/include/sal.h (added)
-
arch/ia64/src/main.c (modified) (3 diffs)
-
arch/ia64/src/pal.c (added)
-
arch/ia64/src/pal_asm.S (added)
-
arch/ia64/src/sal.c (moved) (moved from uspace/app/tester/devs/devman2.c ) (2 diffs)
-
arch/ia64/src/sal_asm.S (added)
-
arch/mips32/src/asm.S (modified) (1 diff)
-
arch/mips64/src/asm.S (modified) (1 diff)
-
genarch/include/efi.h (modified) (2 diffs)
-
genarch/src/efi.c (added)
-
generic/src/printf_core.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile
r867e2555 r925a21e 61 61 cp "$$file" "$(DIST_PATH)/lib/" ; \ 62 62 done 63 ifeq ($(CONFIG_DEVEL_FILES), y) 64 mkdir "$(DIST_PATH)/inc/c/" 65 cp -r -L "$(USPACE_PATH)/lib/c/include/." "$(DIST_PATH)/inc/c/" 66 cat "$(USPACE_PATH)/lib/c/arch/$(UARCH)/_link.ld" | sed 's/^STARTUP(.*)$$//g' > "$(DIST_PATH)/inc/_link.ld" 67 endif 63 68 for file in $(RD_APPS) ; do \ 64 69 cp "$$file" "$(DIST_PATH)/app/" ; \ … … 94 99 rm -rf $(USPACE_PATH)/dist/drv/* 95 100 rm -f $(USPACE_PATH)/dist/lib/* 101 rm -rf $(USPACE_PATH)/dist/inc/* 96 102 rm -f $(USPACE_PATH)/dist/app/* 97 103 rm -f $(USPACE_PATH)/dist/cfg/net/* -
boot/Makefile.common
r867e2555 r925a21e 73 73 $(USPACE_PATH)/srv/loader/loader \ 74 74 $(USPACE_PATH)/app/init/init \ 75 $(USPACE_PATH)/srv/ devmap/devmap\75 $(USPACE_PATH)/srv/loc/loc \ 76 76 $(USPACE_PATH)/srv/bd/rd/rd \ 77 77 $(USPACE_PATH)/srv/vfs/vfs … … 93 93 $(USPACE_PATH)/srv/hid/input/input \ 94 94 $(USPACE_PATH)/srv/hid/console/console \ 95 $(USPACE_PATH)/srv/fs/ devfs/devfs95 $(USPACE_PATH)/srv/fs/locfs/locfs 96 96 97 97 RD_SRVS_NON_ESSENTIAL = \ … … 102 102 $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \ 103 103 $(USPACE_PATH)/srv/fs/fat/fat \ 104 $(USPACE_PATH)/srv/fs/mfs/mfs \ 105 $(USPACE_PATH)/srv/fs/cdfs/cdfs \ 106 $(USPACE_PATH)/srv/fs/exfat/exfat \ 104 107 $(USPACE_PATH)/srv/fs/ext2fs/ext2fs \ 105 108 $(USPACE_PATH)/srv/taskmon/taskmon \ … … 127 130 RD_LIBS = 128 131 132 ifeq ($(CONFIG_DEVEL_FILES), y) 133 RD_LIBS += \ 134 $(USPACE_PATH)/lib/c/libc.a \ 135 $(USPACE_PATH)/lib/softint/libsoftint.a \ 136 $(USPACE_PATH)/lib/softfloat/libsoftfloat.a 137 endif 138 129 139 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y) 130 140 RD_LIBS += \ … … 143 153 $(USPACE_PATH)/app/blkdump/blkdump \ 144 154 $(USPACE_PATH)/app/bnchmark/bnchmark \ 155 $(USPACE_PATH)/app/devctl/devctl \ 145 156 $(USPACE_PATH)/app/dltest/dltest \ 146 157 $(USPACE_PATH)/app/dltest2/dltest2 \ … … 150 161 $(USPACE_PATH)/app/kill/kill \ 151 162 $(USPACE_PATH)/app/killall/killall \ 163 $(USPACE_PATH)/app/locinfo/locinfo \ 152 164 $(USPACE_PATH)/app/mkfat/mkfat \ 165 $(USPACE_PATH)/app/mkmfs/mkmfs \ 153 166 $(USPACE_PATH)/app/lsusb/lsusb \ 154 167 $(USPACE_PATH)/app/sbi/sbi \ 168 $(USPACE_PATH)/app/sportdmp/sportdmp \ 155 169 $(USPACE_PATH)/app/redir/redir \ 156 170 $(USPACE_PATH)/app/taskdump/taskdump \ … … 171 185 $(USPACE_PATH)/app/websrv/websrv 172 186 187 ifeq ($(CONFIG_PCC),y) 188 RD_APPS_NON_ESSENTIAL += \ 189 $(USPACE_PATH)/app/cc/cc \ 190 $(USPACE_PATH)/app/ccom/ccom \ 191 $(USPACE_PATH)/app/ccom/mkext/cc_mkext \ 192 $(USPACE_PATH)/app/cpp/cpp 193 endif 194 195 ifeq ($(CONFIG_BINUTILS),y) 196 RD_APPS_NON_ESSENTIAL += \ 197 $(USPACE_PATH)/app/binutils/bin/as \ 198 $(USPACE_PATH)/app/binutils/bin/ld 199 endif 200 173 201 ifneq ($(CONFIG_BAREBONE),y) 174 202 NET_CFG = \ -
boot/arch/ia64/Makefile.inc
r867e2555 r925a21e 45 45 arch/$(BARCH)/src/asm.S \ 46 46 arch/$(BARCH)/src/main.c \ 47 arch/$(BARCH)/src/sal.c \ 48 arch/$(BARCH)/src/sal_asm.S \ 49 arch/$(BARCH)/src/pal.c \ 50 arch/$(BARCH)/src/pal_asm.S \ 47 51 arch/$(BARCH)/src/putchar.c \ 48 52 $(COMPS_C) \ 53 genarch/src/efi.c \ 49 54 genarch/src/division.c \ 50 55 generic/src/balloc.c \ -
boot/arch/ia64/src/main.c
r867e2555 r925a21e 35 35 #include <arch/_components.h> 36 36 #include <genarch/efi.h> 37 #include <arch/sal.h> 38 #include <arch/pal.h> 37 39 #include <halt.h> 38 40 #include <printf.h> … … 117 119 } 118 120 119 static void read_sal_configuration(void) 120 { 121 if (!bootpar) { 121 static void read_pal_configuration(void) 122 { 123 if (bootpar) { 124 bootinfo.freq_scale = pal_proc_freq_ratio(); 125 } else { 122 126 /* Configure default values for simulators. */ 123 127 bootinfo.freq_scale = DEFAULT_FREQ_SCALE; 124 bootinfo.sys_freq = DEFAULT_SYS_FREQ; 128 } 129 } 130 131 static void read_sal_configuration(void) 132 { 133 if (bootpar && bootpar->efi_system_table) { 134 efi_guid_t sal_guid = SAL_SYSTEM_TABLE_GUID; 135 sal_system_table_header_t *sal_st; 136 137 sal_st = efi_vendor_table_find( 138 (efi_system_table_t *) bootpar->efi_system_table, sal_guid); 139 140 sal_system_table_parse(sal_st); 141 142 bootinfo.sys_freq = sal_base_clock_frequency(); 125 143 } else { 126 /* TODO: read the real values from SAL */ 127 bootinfo.freq_scale = DEFAULT_FREQ_SCALE; 144 /* Configure default values for simulators. */ 128 145 bootinfo.sys_freq = DEFAULT_SYS_FREQ; 129 146 } … … 189 206 read_efi_memmap(); 190 207 read_sal_configuration(); 208 read_pal_configuration(); 191 209 192 210 printf("Booting the kernel ...\n"); -
boot/arch/ia64/src/sal.c
r867e2555 r925a21e 1 1 /* 2 * Copyright (c) 2011 Vojtech Horky2 * Copyright (c) 2011 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup tester 30 * @brief Test devman service. 31 * @{ 32 */ 33 /** 34 * @file 35 */ 29 #include <arch/sal.h> 30 #include <arch/types.h> 36 31 37 #include <inttypes.h> 38 #include <errno.h> 39 #include <str_error.h> 40 #include <sys/types.h> 41 #include <async.h> 42 #include <devman.h> 43 #include <str.h> 44 #include <async.h> 45 #include <vfs/vfs.h> 46 #include <vfs/vfs_sess.h> 47 #include <sys/stat.h> 48 #include <fcntl.h> 49 #include "../tester.h" 32 static sal_ap_wakeup_desc_t *sal_ap_wakeup; 50 33 51 #define DEVICE_CLASS "test3" 34 extern uint64_t pal_proc; 52 35 53 const char *test_devman2(void) 36 uint64_t sal_proc = 0; 37 uint64_t sal_proc_gp = 0; 38 39 void sal_system_table_parse(sal_system_table_header_t *sst) 54 40 { 55 size_t idx = 1; 56 int rc = EOK; 57 const char *err_msg = NULL; 58 char *path = NULL; 59 while (rc == EOK) { 60 rc = asprintf(&path, "/dev/class/%s\\%zu", DEVICE_CLASS, idx); 61 if (rc < 0) { 62 continue; 41 uint8_t *cur = (uint8_t *) &sst[1]; 42 uint16_t entry; 43 44 for (entry = 0; entry < sst->entry_count; entry++) { 45 switch ((sal_sst_type_t) *cur) { 46 case SSTT_ENTRYPOINT_DESC: 47 pal_proc = ((sal_entrypoint_desc_t *) cur)->pal_proc; 48 sal_proc = ((sal_entrypoint_desc_t *) cur)->sal_proc; 49 sal_proc_gp = ((sal_entrypoint_desc_t *) cur)->sal_proc_gp; 50 cur += sizeof(sal_entrypoint_desc_t); 51 break; 52 case SSTT_MEMORY_DESC: 53 cur += sizeof(sal_memory_desc_t); 54 break; 55 case SSTT_PLATFORM_FEATURES_DESC: 56 cur += sizeof(sal_platform_features_desc_t); 57 break; 58 case SSTT_TR_DESC: 59 cur += sizeof(sal_tr_desc_t); 60 break; 61 case SSTT_PTC_COHERENCE_DOMAIN_DESC: 62 cur += sizeof(sal_ptc_coherence_domain_desc_t); 63 break; 64 case SSTT_AP_WAKEUP_DESC: 65 sal_ap_wakeup = (sal_ap_wakeup_desc_t *) cur; 66 cur += sizeof(sal_ap_wakeup_desc_t); 67 break; 68 default: 69 return; 63 70 } 64 int fd = open(path, O_RDONLY);65 if (fd < 0) {66 TPRINTF("Failed opening `%s': %s.\n",67 path, str_error(fd));68 rc = fd;69 err_msg = "Failed opening file";70 continue;71 }72 async_sess_t *sess = fd_session(EXCHANGE_SERIALIZE, fd);73 close(fd);74 if (sess == NULL) {75 TPRINTF("Failed opening phone: %s.\n", str_error(errno));76 rc = errno;77 err_msg = "Failed opening file descriptor phone";78 continue;79 }80 async_hangup(sess);81 TPRINTF("Path `%s' okay.\n", path);82 free(path);83 idx++;84 rc = EOK;85 71 } 86 87 if (path != NULL)88 free(path);89 90 return err_msg;91 72 } 92 73 93 /** @} 94 */ 74 uint64_t sal_base_clock_frequency(void) 75 { 76 uint64_t freq; 77 78 sal_call_1_1(SAL_FREQ_BASE, 0, &freq); 79 80 return freq; 81 } -
boot/arch/mips32/src/asm.S
r867e2555 r925a21e 44 44 * Setup the CP0 configuration 45 45 * - Disable 64-bit kernel addressing mode 46 * - D Isable 64-bit supervisor adressing mode46 * - Disable 64-bit supervisor adressing mode 47 47 * - Disable 64-bit user addressing mode 48 48 */ -
boot/arch/mips64/src/asm.S
r867e2555 r925a21e 47 47 * - Enable 64-bit user addressing mode 48 48 */ 49 dmfc0 $a0, $status49 mfc0 $a0, $status 50 50 ori $a0, 0x00e0 51 dmtc0 $a0, $status51 mtc0 $a0, $status 52 52 53 53 /* -
boot/genarch/include/efi.h
r867e2555 r925a21e 30 30 #define BOOT_EFI_H_ 31 31 32 #include <arch/types.h> 33 34 typedef struct { 35 uint64_t signature; 36 uint32_t revision; 37 uint32_t header_size; 38 uint32_t crc32; 39 uint32_t reserved; 40 } efi_table_header_t; 41 42 #define SAL_SYSTEM_TABLE_GUID \ 43 { \ 44 { \ 45 0x32, 0x2d, 0x9d, 0xeb, 0x88, 0x2d, 0xd3, 0x11, \ 46 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \ 47 } \ 48 } 49 50 typedef union { 51 uint8_t bytes[16]; 52 struct { 53 uint64_t low; 54 uint64_t high; 55 }; 56 } efi_guid_t; 57 58 typedef struct { 59 efi_guid_t guid; 60 void *table; 61 } efi_configuration_table_t; 62 63 typedef struct { 64 efi_table_header_t hdr; 65 char *fw_vendor; 66 uint32_t fw_revision; 67 void *cons_in_handle; 68 void *cons_in; 69 void *cons_out_handle; 70 void *cons_out; 71 void *cons_err_handle; 72 void *cons_err; 73 void *runtime_services; 74 void *boot_services; 75 sysarg_t conf_table_entries; 76 efi_configuration_table_t *conf_table; 77 } efi_system_table_t; 78 32 79 typedef enum { 33 80 EFI_RESERVED, … … 57 104 #define EFI_PAGE_SIZE 4096 58 105 106 extern void *efi_vendor_table_find(efi_system_table_t *, efi_guid_t); 107 59 108 #endif -
boot/generic/src/printf_core.c
r867e2555 r925a21e 70 70 */ 71 71 #define PRINT_NUMBER_BUFFER_SIZE (64 + 5) 72 73 /** Get signed or unsigned integer argument */ 74 #define PRINTF_GET_INT_ARGUMENT(type, ap, flags) \ 75 ({ \ 76 unsigned type res; \ 77 \ 78 if ((flags) & __PRINTF_FLAG_SIGNED) { \ 79 signed type arg = va_arg((ap), signed type); \ 80 \ 81 if (arg < 0) { \ 82 res = -arg; \ 83 (flags) |= __PRINTF_FLAG_NEGATIVE; \ 84 } else \ 85 res = arg; \ 86 } else \ 87 res = va_arg((ap), unsigned type); \ 88 \ 89 res; \ 90 }) 72 91 73 92 /** Enumeration of possible arguments types. … … 171 190 } 172 191 173 return (int) (counter + 1);192 return (int) (counter); 174 193 } 175 194 … … 698 717 size_t size; 699 718 uint64_t number; 719 700 720 switch (qualifier) { 701 721 case PrintfQualifierByte: 702 722 size = sizeof(unsigned char); 703 number = (uint64_t) va_arg(ap, unsigned int);723 number = PRINTF_GET_INT_ARGUMENT(int, ap, flags); 704 724 break; 705 725 case PrintfQualifierShort: 706 726 size = sizeof(unsigned short); 707 number = (uint64_t) va_arg(ap, unsigned int);727 number = PRINTF_GET_INT_ARGUMENT(int, ap, flags); 708 728 break; 709 729 case PrintfQualifierInt: 710 730 size = sizeof(unsigned int); 711 number = (uint64_t) va_arg(ap, unsigned int);731 number = PRINTF_GET_INT_ARGUMENT(int, ap, flags); 712 732 break; 713 733 case PrintfQualifierLong: 714 734 size = sizeof(unsigned long); 715 number = (uint64_t) va_arg(ap, unsigned long);735 number = PRINTF_GET_INT_ARGUMENT(long, ap, flags); 716 736 break; 717 737 case PrintfQualifierLongLong: 718 738 size = sizeof(unsigned long long); 719 number = (uint64_t) va_arg(ap, unsigned long long);739 number = PRINTF_GET_INT_ARGUMENT(long long, ap, flags); 720 740 break; 721 741 case PrintfQualifierPointer: … … 732 752 counter = -counter; 733 753 goto out; 734 }735 736 if (flags & __PRINTF_FLAG_SIGNED) {737 if (number & (0x1 << (size * 8 - 1))) {738 flags |= __PRINTF_FLAG_NEGATIVE;739 740 if (size == sizeof(uint64_t)) {741 number = -((int64_t) number);742 } else {743 number = ~number;744 number &=745 ~(0xFFFFFFFFFFFFFFFFll <<746 (size * 8));747 number++;748 }749 }750 754 } 751 755
Note:
See TracChangeset
for help on using the changeset viewer.
