Changes in / [94e46c9:a25d893] in mainline
- Files:
-
- 40 deleted
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r94e46c9 ra25d893 20 20 kernel/arch/amd64/include/arch/common.h 21 21 kernel/generic/src/debug/real_map.bin 22 uspace/app/barber/barber23 uspace/app/barber/images.c24 uspace/app/barber/images.h25 22 uspace/app/bdsh/bdsh 26 23 uspace/app/bdsh/test-bdsh … … 28 25 uspace/app/blkdump/blkdump 29 26 uspace/app/bnchmark/bnchmark 30 uspace/drv/char/pl050/pl05031 27 uspace/app/date/date 32 28 uspace/app/devctl/devctl … … 48 44 uspace/app/mkfat/mkfat 49 45 uspace/app/mkmfs/mkmfs 50 uspace/app/modplay/modplay51 46 uspace/app/netecho/netecho 52 47 uspace/app/nettest1/nettest1 … … 57 52 uspace/app/ping/ping 58 53 uspace/app/ping6/ping6 59 uspace/app/rcubench/rcubench60 uspace/app/rcutest/rcutest61 54 uspace/app/redir/redir 62 55 uspace/app/sbi/sbi … … 80 73 uspace/app/wavplay/wavplay 81 74 uspace/app/websrv/websrv 82 uspace/dist/app/barber83 75 uspace/dist/app/bdsh 84 76 uspace/dist/app/bithenge … … 103 95 uspace/dist/app/mkfat 104 96 uspace/dist/app/mkmfs 105 uspace/dist/app/modplay106 97 uspace/dist/app/netecho 107 98 uspace/dist/app/nettest1 … … 112 103 uspace/dist/app/ping 113 104 uspace/dist/app/ping6 114 uspace/dist/app/rcubench115 uspace/dist/app/rcutest116 105 uspace/dist/app/redir 117 106 uspace/dist/app/sbi … … 145 134 uspace/dist/drv/ns8250/ 146 135 uspace/dist/drv/ohci/ 147 uspace/dist/drv/pc/148 136 uspace/dist/drv/pciintel/ 149 137 uspace/dist/drv/ps2mouse/ … … 221 209 uspace/drv/root/root/root 222 210 uspace/drv/root/virt/virt 223 uspace/drv/platform/icp/icp224 uspace/drv/platform/pc/pc225 211 uspace/drv/platform/rootpc/rootpc 226 212 uspace/drv/nic/e1k/e1k -
boot/Makefile
r94e46c9 ra25d893 115 115 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/$$file_name.dev" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \ 116 116 done 117 for file in $(RD_DRVS_FW) ; do \118 file_dir="`dirname "$$file"`" ; \119 file_name="`basename "$$file"`" ; \120 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/$$file_name.fw" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \121 done122 117 if ls $(DIST_OVERLAY_PATH)/* >/dev/null; then \ 123 118 cp -r -L $(DIST_OVERLAY_PATH)/* "$(DIST_PATH)"; \ -
boot/Makefile.common
r94e46c9 ra25d893 139 139 nic/rtl8139 \ 140 140 nic/rtl8169 \ 141 nic/ar9271 \142 141 block/ahci 143 142 144 143 RD_DRV_CFG = 145 146 RD_DRVS_FW_NON_ESSENTIAL = \147 nic/ar9271148 144 149 145 RD_LIBS = … … 227 223 $(USPACE_PATH)/app/viewer/viewer \ 228 224 $(USPACE_PATH)/app/df/df \ 229 $(USPACE_PATH)/app/fontviewer/fontviewer \ 230 $(USPACE_PATH)/app/wifi_supplicant/wifi_supplicant 225 $(USPACE_PATH)/app/fontviewer/fontviewer 231 226 232 227 RD_TESTS = \ … … 252 247 RD_APPS = $(RD_APPS_ESSENTIAL) 253 248 RD_DRVS = $(RD_DRVS_ESSENTIAL) 254 RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL)255 249 else 256 250 RD_SRVS = $(RD_SRVS_ESSENTIAL) $(RD_SRVS_NON_ESSENTIAL) 257 251 RD_APPS = $(RD_APPS_ESSENTIAL) $(RD_APPS_NON_ESSENTIAL) 258 252 RD_DRVS = $(RD_DRVS_ESSENTIAL) $(RD_DRVS_NON_ESSENTIAL) 259 RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL) $(RD_DRVS_FW_NON_ESSENTIAL)260 253 endif 261 254 -
boot/arch/mips32/Makefile.inc
r94e46c9 ra25d893 64 64 endif 65 65 66 ifeq ($(MACHINE),msim)67 RD_DRVS_ESSENTIAL += \68 platform/msim \69 block/ddisk70 endif71 72 66 SOURCES = \ 73 67 arch/$(BARCH)/src/asm.S \ -
contrib/conf/msim.conf
r94e46c9 ra25d893 17 17 add dkeyboard keyboard 0x10000000 2 18 18 add dorder order 0x10000100 5 19 20 add ddisk disk 0x10000200 621 disk fmap "hdisk.img"22 -
contrib/qfs/qfs.sh
r94e46c9 ra25d893 29 29 # 30 30 31 VERSION=2. 3.031 VERSION=2.2.0 32 32 BASENAME=qemu-${VERSION} 33 33 BASENAME_MASTER=qemu-master … … 36 36 URL=http://wiki.qemu-project.org/download/${TARBALL} 37 37 REPO=git://git.qemu.org/qemu.git 38 MD5=" 2fab3ea4460de9b57192e5b8b311f221"38 MD5="f7a5e2da22d057eb838a91da7aff43c8" 39 39 40 40 if [ "$1" == "--master" ]; then -
defaults/arm32/integratorcp/Makefile.config
r94e46c9 ra25d893 1 1 # Machine type 2 2 MACHINE = integratorcp 3 4 # Barebone build with essential binaries only5 CONFIG_BAREBONE = y6 -
kernel/arch/mips32/include/arch/drivers/msim.h
r94e46c9 ra25d893 39 39 #define MSIM_VIDEORAM 0x90000000 40 40 #define MSIM_KBD_ADDRESS 0x90000000 41 42 41 #define MSIM_KBD_IRQ 2 43 #define MSIM_DDISK_IRQ 644 42 45 43 #endif -
kernel/arch/mips32/src/mach/msim/msim.c
r94e46c9 ra25d893 62 62 void msim_init(void) 63 63 { 64 cp0_unmask_int(MSIM_DDISK_IRQ);65 64 } 66 65 -
tools/toolchain.sh
r94e46c9 ra25d893 513 513 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" ./configure \ 514 514 "--target=${TARGET}" \ 515 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 516 --enable-werror=no 515 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 517 516 check_error $? "Error configuring GDB." 518 517 -
uspace/Makefile
r94e46c9 ra25d893 94 94 app/wavplay \ 95 95 app/websrv \ 96 app/wifi_supplicant \97 96 srv/audio/hound \ 98 97 srv/clipboard \ … … 142 141 drv/block/ahci \ 143 142 drv/block/ata_bd \ 144 drv/block/ddisk \145 143 drv/char/i8042 \ 146 144 drv/char/pl050 \ … … 164 162 drv/nic/rtl8139 \ 165 163 drv/nic/rtl8169 \ 166 drv/nic/ar9271 \167 164 drv/platform/icp 168 165 … … 182 179 183 180 ifeq ($(UARCH), $(filter $(UARCH),mips32 mips32eb)) 184 ifeq ($(MACHINE),msim)185 DIRS += \186 drv/platform/msim187 else188 181 DIRS += \ 189 182 drv/platform/malta \ 190 183 drv/bus/pci/pciintel \ 191 184 drv/bus/isa 192 endif193 185 endif 194 186 … … 219 211 lib/fs \ 220 212 lib/block \ 221 lib/crypto \222 213 lib/clui \ 223 214 lib/fmtutil \ … … 250 241 lib/posix \ 251 242 lib/mbr \ 252 lib/gpt \ 253 lib/ieee80211 243 lib/gpt 254 244 255 245 LIBC_BUILD = $(addsuffix .build,$(LIBC)) -
uspace/Makefile.common
r94e46c9 ra25d893 120 120 LIBPOSIX_PREFIX = $(LIB_PREFIX)/posix 121 121 122 LIBCRYPTO_PREFIX = $(LIB_PREFIX)/crypto123 122 LIBBLOCK_PREFIX = $(LIB_PREFIX)/block 124 123 LIBFS_PREFIX = $(LIB_PREFIX)/fs … … 144 143 LIBNET_PREFIX = $(LIB_PREFIX)/net 145 144 LIBNIC_PREFIX = $(LIB_PREFIX)/nic 146 LIBIEEE80211_PREFIX = $(LIB_PREFIX)/ieee80211147 145 LIBMINIX_PREFIX = $(LIB_PREFIX)/minix 148 146 LIBCOMPRESS_PREFIX = $(LIB_PREFIX)/compress -
uspace/app/bdsh/cmds/modules/cat/cat.c
r94e46c9 ra25d893 324 324 argc = cli_count_args(argv); 325 325 326 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {326 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 327 327 c = getopt_long(argc, argv, "xhvmH:t:b:s:n", long_options, &opt_ind); 328 328 switch (c) { -
uspace/app/bdsh/cmds/modules/cmp/cmp.c
r94e46c9 ra25d893 130 130 argc = cli_count_args(argv); 131 131 132 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {132 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 133 133 c = getopt_long(argc, argv, "hv", long_options, &opt_ind); 134 134 switch (c) { -
uspace/app/bdsh/cmds/modules/cp/cp.c
r94e46c9 ra25d893 457 457 argc = cli_count_args(argv); 458 458 459 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {459 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 460 460 c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind); 461 461 switch (c) { -
uspace/app/bdsh/cmds/modules/ls/ls.c
r94e46c9 ra25d893 362 362 argc = cli_count_args(argv); 363 363 364 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {364 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 365 365 c = getopt_long(argc, argv, "hur", long_options, &opt_ind); 366 366 switch (c) { -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r94e46c9 ra25d893 173 173 argc = cli_count_args(argv); 174 174 175 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {175 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 176 176 c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind); 177 177 switch (c) { -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r94e46c9 ra25d893 126 126 argc = cli_count_args(argv); 127 127 128 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {128 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 129 129 c = getopt_long(argc, argv, "ps:h", long_options, &opt_ind); 130 130 switch (c) { -
uspace/app/bdsh/cmds/modules/mount/mount.c
r94e46c9 ra25d893 118 118 argc = cli_count_args(argv); 119 119 120 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {120 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 121 121 c = getopt_long(argc, argv, "i:h", long_options, &opt_ind); 122 122 switch (c) { -
uspace/app/bdsh/cmds/modules/rm/rm.c
r94e46c9 ra25d893 261 261 } 262 262 263 for (c = 0, opt reset = 1, optind = 0, opt_ind = 0; c != -1;) {263 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { 264 264 c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind); 265 265 switch (c) { -
uspace/app/bdsh/cmds/modules/touch/touch.c
r94e46c9 ra25d893 90 90 DIR *dirp; 91 91 92 for (c = 0, opt reset = 1, optind = 0, longind = 0; c != -1; ) {92 for (c = 0, optind = 0, longind = 0; c != -1; ) { 93 93 c = getopt_long(argc, argv, "c", long_options, &longind); 94 94 switch (c) { -
uspace/app/wavplay/drec.c
r94e46c9 ra25d893 47 47 48 48 49 #define BUFFER_PARTS 1649 #define BUFFER_PARTS 2 50 50 51 51 /** Recording format */ … … 103 103 printf("Recording terminated\n"); 104 104 record = false; 105 break;106 105 case PCM_EVENT_FRAMES_CAPTURED: 107 106 printf("%" PRIun " frames\n", IPC_GET_ARG1(call)); 107 async_answer_0(callid, EOK); 108 108 break; 109 109 default: … … 111 111 async_answer_0(callid, ENOTSUP); 112 112 continue; 113 } 114 115 if (!record) { 116 async_answer_0(callid, EOK); 117 break; 113 118 114 } 119 115 … … 160 156 printf("\n"); 161 157 audio_pcm_stop_capture(rec->device); 162 /* XXX Control returns even before we can be sure callbacks finished */163 printf("Delay before playback termination\n");164 async_usleep(1000000);165 printf("Terminate playback\n");166 158 } 167 159 -
uspace/app/wavplay/main.c
r94e46c9 ra25d893 308 308 if (direct) { 309 309 drecord(device, file); 310 continue;311 310 } else { 312 311 printf("Indirect recording is not supported " -
uspace/app/wavplay/wave.c
r94e46c9 ra25d893 116 116 *channels = uint16_t_le2host(header->channels); 117 117 if (format) { 118 const unsigned size = uint 16_t_le2host(header->sample_size);118 const unsigned size = uint32_t_le2host(header->sample_size); 119 119 switch (size) { 120 120 case 8: *format = PCM_SAMPLE_UINT8; break; … … 157 157 header->channels = host2uint32_t_le(format.channels); 158 158 header->sample_size = 159 host2uint 16_t_le(pcm_sample_format_size(format.sample_format) * 8);159 host2uint32_t_le(pcm_sample_format_size(format.sample_format)); 160 160 } 161 161 /** -
uspace/drv/audio/hdaudio/codec.c
r94e46c9 ra25d893 437 437 } 438 438 439 if ((pcaps & BIT_V(uint32_t, pwc_input)) != 0) {440 ddf_msg(LVL_NOTE, "PIN %d will enable input", aw);441 pctl = pctl | BIT_V(uint8_t, pctl_in_enable);442 }443 444 439 if ((pcaps & BIT_V(uint32_t, pwc_hpd)) != 0) { 445 440 ddf_msg(LVL_NOTE, "PIN %d will enable headphone drive", aw); … … 508 503 codec->hda = hda; 509 504 codec->address = address; 510 codec->in_aw = -1;511 505 512 506 rc = hda_get_subnc(codec, 0, &sfg, &nfg); … … 593 587 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x", 594 588 aw, rates, formats); 595 } else if (awtype == awt_audio_input) {596 if (codec->in_aw < 0) {597 ddf_msg(LVL_NOTE, "Selected input "598 "widget %d\n", aw);599 codec->in_aw = aw;600 } else {601 ddf_msg(LVL_NOTE, "Ignoring input "602 "widget %d\n", aw);603 }604 605 rc = hda_get_supp_rates(codec, aw, &rates);606 if (rc != EOK)607 goto error;608 609 rc = hda_get_supp_formats(codec, aw, &formats);610 if (rc != EOK)611 goto error;612 613 ddf_msg(LVL_NOTE, "Input widget %d: rates=0x%x formats=0x%x",614 aw, rates, formats);615 589 } 616 590 … … 649 623 /* Configure converter */ 650 624 651 ddf_msg(LVL_NOTE, "Configure outputconverter format");625 ddf_msg(LVL_NOTE, "Configure converter format"); 652 626 rc = hda_set_converter_fmt(codec, out_aw, stream->fmt); 653 627 if (rc != EOK) 654 628 goto error; 655 629 656 ddf_msg(LVL_NOTE, "Configure outputconverter stream, channel");630 ddf_msg(LVL_NOTE, "Configure converter stream, channel"); 657 631 rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0); 658 632 if (rc != EOK) 659 633 goto error; 660 634 } 661 662 return EOK;663 error:664 return rc;665 }666 667 int hda_in_converter_setup(hda_codec_t *codec, hda_stream_t *stream)668 {669 int rc;670 671 /* Configure converter */672 673 ddf_msg(LVL_NOTE, "Configure input converter format");674 rc = hda_set_converter_fmt(codec, codec->in_aw, stream->fmt);675 if (rc != EOK)676 goto error;677 678 ddf_msg(LVL_NOTE, "Configure input converter stream, channel");679 rc = hda_set_converter_ctl(codec, codec->in_aw, stream->sid, 0);680 if (rc != EOK)681 goto error;682 635 683 636 return EOK; -
uspace/drv/audio/hdaudio/codec.h
r94e46c9 ra25d893 47 47 int out_aw_num; 48 48 int out_aw_sel; 49 int in_aw;50 49 } hda_codec_t; 51 50 … … 53 52 extern void hda_codec_fini(hda_codec_t *); 54 53 extern int hda_out_converter_setup(hda_codec_t *, hda_stream_t *); 55 extern int hda_in_converter_setup(hda_codec_t *, hda_stream_t *);56 54 57 55 #endif -
uspace/drv/audio/hdaudio/hdactl.c
r94e46c9 ra25d893 562 562 ctl->bss = BIT_RANGE_EXTRACT(uint16_t, gcap_bss_h, gcap_bss_l, gcap); 563 563 ddf_msg(LVL_NOTE, "GCAP: 0x%x (64OK=%d)", gcap, ctl->ok64bit); 564 ddf_msg(LVL_NOTE, "iss: %d, oss: %d, bss: %d\n", 565 ctl->iss, ctl->oss, ctl->bss); 564 566 565 /* Give codecs enough time to enumerate themselves */ 567 566 async_usleep(codec_enum_wait_us); -
uspace/drv/audio/hdaudio/hdaudio.c
r94e46c9 ra25d893 385 385 hda_pcm_event(hda, PCM_EVENT_FRAMES_PLAYED); 386 386 hda_pcm_event(hda, PCM_EVENT_FRAMES_PLAYED); 387 } else if (hda->capturing) {388 hda_pcm_event(hda, PCM_EVENT_FRAMES_CAPTURED);389 hda_pcm_event(hda, PCM_EVENT_FRAMES_CAPTURED);390 hda_pcm_event(hda, PCM_EVENT_FRAMES_CAPTURED);391 hda_pcm_event(hda, PCM_EVENT_FRAMES_CAPTURED);392 387 } 393 394 388 hda_unlock(hda); 395 389 } -
uspace/drv/audio/hdaudio/hdaudio.h
r94e46c9 ra25d893 55 55 struct hda_ctl *ctl; 56 56 struct hda_stream *pcm_stream; 57 struct hda_stream_buffers *pcm_buffers;58 57 bool playing; 59 bool capturing;60 58 } hda_t; 61 59 -
uspace/drv/audio/hdaudio/pcm_iface.c
r94e46c9 ra25d893 100 100 static unsigned hda_query_cap(ddf_fun_t *fun, audio_cap_t cap) 101 101 { 102 hda_t *hda = fun_to_hda(fun);103 104 102 ddf_msg(LVL_NOTE, "hda_query_cap(%d)", cap); 105 103 switch (cap) { 106 104 case AUDIO_CAP_PLAYBACK: 107 105 case AUDIO_CAP_INTERRUPT: 108 /* XXX Only if we have an output converter */109 106 return 1; 107 case AUDIO_CAP_BUFFER_POS: 110 108 case AUDIO_CAP_CAPTURE: 111 /* Yes if we have an input converter */112 return hda->ctl->codec->in_aw >= 0;113 case AUDIO_CAP_BUFFER_POS:114 109 return 0; 115 110 case AUDIO_CAP_MAX_BUFFER: … … 153 148 { 154 149 hda_t *hda = fun_to_hda(fun); 155 int rc;156 150 157 151 hda_lock(hda); 158 152 159 153 ddf_msg(LVL_NOTE, "hda_get_buffer(): hda=%p", hda); 160 if (hda->pcm_buffers != NULL) {161 hda_unlock(hda);162 return EBUSY;163 }164 165 ddf_msg(LVL_NOTE, "hda_get_buffer() - allocate stream buffers");166 rc = hda_stream_buffers_alloc(hda, &hda->pcm_buffers);167 if (rc != EOK) {168 assert(rc == ENOMEM);169 hda_unlock(hda);170 return ENOMEM;171 }172 173 ddf_msg(LVL_NOTE, "hda_get_buffer() - fill info");174 /* XXX This is only one buffer */175 *buffer = hda->pcm_buffers->buf[0];176 *size = hda->pcm_buffers->bufsize * hda->pcm_buffers->nbuffers;177 178 ddf_msg(LVL_NOTE, "hda_get_buffer() returing EOK, buffer=%p, size=%zu",179 *buffer, *size);180 181 hda_unlock(hda);182 return EOK;183 }184 185 static int hda_get_buffer_position(ddf_fun_t *fun, size_t *pos)186 {187 ddf_msg(LVL_NOTE, "hda_get_buffer_position()");188 return ENOTSUP;189 }190 191 static int hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess)192 {193 hda_t *hda = fun_to_hda(fun);194 195 ddf_msg(LVL_NOTE, "hda_set_event_session()");196 hda_lock(hda);197 hda->ev_sess = sess;198 hda_unlock(hda);199 200 return EOK;201 }202 203 static async_sess_t *hda_get_event_session(ddf_fun_t *fun)204 {205 hda_t *hda = fun_to_hda(fun);206 async_sess_t *sess;207 208 ddf_msg(LVL_NOTE, "hda_get_event_session()");209 210 hda_lock(hda);211 sess = hda->ev_sess;212 hda_unlock(hda);213 214 return sess;215 }216 217 static int hda_release_buffer(ddf_fun_t *fun)218 {219 hda_t *hda = fun_to_hda(fun);220 221 hda_lock(hda);222 223 ddf_msg(LVL_NOTE, "hda_release_buffer()");224 if (hda->pcm_buffers == NULL) {225 hda_unlock(hda);226 return EINVAL;227 }228 229 hda_stream_buffers_free(hda->pcm_buffers);230 hda->pcm_buffers = NULL;231 232 hda_unlock(hda);233 return EOK;234 }235 236 static int hda_start_playback(ddf_fun_t *fun, unsigned frames,237 unsigned channels, unsigned rate, pcm_sample_format_t format)238 {239 hda_t *hda = fun_to_hda(fun);240 int rc;241 242 ddf_msg(LVL_NOTE, "hda_start_playback()");243 hda_lock(hda);244 245 154 if (hda->pcm_stream != NULL) { 246 155 hda_unlock(hda); … … 253 162 fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l) | 1; 254 163 255 ddf_msg(LVL_NOTE, "hda_start_playback() - create output stream"); 256 hda->pcm_stream = hda_stream_create(hda, sdir_output, hda->pcm_buffers, 257 fmt); 164 ddf_msg(LVL_NOTE, "hda_get_buffer() - create stream"); 165 hda->pcm_stream = hda_stream_create(hda, sdir_output, fmt); 258 166 if (hda->pcm_stream == NULL) { 259 167 hda_unlock(hda); 260 168 return EIO; 261 169 } 170 171 ddf_msg(LVL_NOTE, "hda_get_buffer() - fill info"); 172 /* XXX This is only one buffer */ 173 *buffer = hda->pcm_stream->buf[0]; 174 *size = hda->pcm_stream->bufsize * hda->pcm_stream->nbuffers; 175 176 ddf_msg(LVL_NOTE, "hda_get_buffer() retturing EOK, buffer=%p, size=%zu", 177 *buffer, *size); 178 179 hda_unlock(hda); 180 return EOK; 181 } 182 183 static int hda_get_buffer_position(ddf_fun_t *fun, size_t *pos) 184 { 185 ddf_msg(LVL_NOTE, "hda_get_buffer_position()"); 186 return ENOTSUP; 187 } 188 189 static int hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess) 190 { 191 hda_t *hda = fun_to_hda(fun); 192 193 ddf_msg(LVL_NOTE, "hda_set_event_session()"); 194 hda_lock(hda); 195 hda->ev_sess = sess; 196 hda_unlock(hda); 197 198 return EOK; 199 } 200 201 static async_sess_t *hda_get_event_session(ddf_fun_t *fun) 202 { 203 hda_t *hda = fun_to_hda(fun); 204 async_sess_t *sess; 205 206 ddf_msg(LVL_NOTE, "hda_get_event_session()"); 207 208 hda_lock(hda); 209 sess = hda->ev_sess; 210 hda_unlock(hda); 211 212 return sess; 213 } 214 215 static int hda_release_buffer(ddf_fun_t *fun) 216 { 217 hda_t *hda = fun_to_hda(fun); 218 219 hda_lock(hda); 220 221 ddf_msg(LVL_NOTE, "hda_release_buffer()"); 222 if (hda->pcm_stream == NULL) { 223 hda_unlock(hda); 224 return EINVAL; 225 } 226 227 hda_stream_destroy(hda->pcm_stream); 228 hda->pcm_stream = NULL; 229 230 hda_unlock(hda); 231 return EOK; 232 } 233 234 static int hda_start_playback(ddf_fun_t *fun, unsigned frames, 235 unsigned channels, unsigned rate, pcm_sample_format_t format) 236 { 237 hda_t *hda = fun_to_hda(fun); 238 int rc; 239 240 ddf_msg(LVL_NOTE, "hda_start_playback()"); 241 hda_lock(hda); 262 242 263 243 rc = hda_out_converter_setup(hda->ctl->codec, hda->pcm_stream); 264 244 if (rc != EOK) { 265 hda_stream_destroy(hda->pcm_stream);266 hda->pcm_stream = NULL;267 245 hda_unlock(hda); 268 246 return rc; 269 247 } 270 248 249 hda_stream_start(hda->pcm_stream); 271 250 hda->playing = true; 272 hda_stream_start(hda->pcm_stream);273 251 hda_unlock(hda); 274 252 return EOK; … … 284 262 hda_stream_reset(hda->pcm_stream); 285 263 hda->playing = false; 286 hda_stream_destroy(hda->pcm_stream);287 hda->pcm_stream = NULL;288 289 264 hda_unlock(hda); 290 265 … … 296 271 unsigned rate, pcm_sample_format_t format) 297 272 { 298 hda_t *hda = fun_to_hda(fun);299 int rc;300 301 273 ddf_msg(LVL_NOTE, "hda_start_capture()"); 302 hda_lock(hda); 303 304 if (hda->pcm_stream != NULL) { 305 hda_unlock(hda); 306 return EBUSY; 307 } 308 309 /* XXX Choose appropriate parameters */ 310 uint32_t fmt; 311 /* 48 kHz, 16-bits, 1 channel */ 312 fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l) | 1; 313 314 ddf_msg(LVL_NOTE, "hda_start_capture() - create input stream"); 315 hda->pcm_stream = hda_stream_create(hda, sdir_input, hda->pcm_buffers, 316 fmt); 317 if (hda->pcm_stream == NULL) { 318 hda_unlock(hda); 319 return EIO; 320 } 321 322 rc = hda_in_converter_setup(hda->ctl->codec, hda->pcm_stream); 323 if (rc != EOK) { 324 hda_stream_destroy(hda->pcm_stream); 325 hda->pcm_stream = NULL; 326 hda_unlock(hda); 327 return rc; 328 } 329 330 hda->capturing = true; 331 hda_stream_start(hda->pcm_stream); 332 hda_unlock(hda); 333 return EOK; 274 return ENOTSUP; 334 275 } 335 276 336 277 static int hda_stop_capture(ddf_fun_t *fun, bool immediate) 337 278 { 338 hda_t *hda = fun_to_hda(fun);339 340 279 ddf_msg(LVL_NOTE, "hda_stop_capture()"); 341 hda_lock(hda); 342 hda_stream_stop(hda->pcm_stream); 343 hda_stream_reset(hda->pcm_stream); 344 hda->capturing = false; 345 hda_stream_destroy(hda->pcm_stream); 346 hda->pcm_stream = NULL; 347 hda_unlock(hda); 348 349 hda_pcm_event(hda, PCM_EVENT_CAPTURE_TERMINATED); 350 return EOK; 280 return ENOTSUP; 351 281 } 352 282 -
uspace/drv/audio/hdaudio/stream.c
r94e46c9 ra25d893 48 48 #include "stream.h" 49 49 50 int hda_stream_buffers_alloc(hda_t *hda, hda_stream_buffers_t **rbufs)50 static int hda_stream_buffers_alloc(hda_stream_t *stream) 51 51 { 52 52 void *bdl; 53 53 void *buffer; 54 54 uintptr_t buffer_phys; 55 hda_stream_buffers_t *bufs = NULL;56 55 size_t i; 57 56 // size_t j, k; 58 57 int rc; 59 58 60 bufs = calloc(1, sizeof(hda_stream_buffers_t)); 61 if (bufs == NULL) { 62 rc = ENOMEM; 63 goto error; 64 } 65 66 bufs->nbuffers = 4; 67 bufs->bufsize = 16384; 59 stream->nbuffers = 4; 60 stream->bufsize = 16384; 68 61 69 62 /* … … 72 65 */ 73 66 bdl = AS_AREA_ANY; 74 rc = dmamem_map_anonymous( bufs->nbuffers * sizeof(hda_buffer_desc_t),75 hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE,76 0, & bufs->bdl_phys, &bdl);67 rc = dmamem_map_anonymous(stream->nbuffers * sizeof(hda_buffer_desc_t), 68 stream->hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 69 0, &stream->bdl_phys, &bdl); 77 70 if (rc != EOK) 78 71 goto error; 79 72 80 bufs->bdl = bdl;73 stream->bdl = bdl; 81 74 82 75 /* Allocate arrays of buffer pointers */ 83 76 84 bufs->buf = calloc(bufs->nbuffers, sizeof(void *));85 if ( bufs->buf == NULL)86 goto error; 87 88 bufs->buf_phys = calloc(bufs->nbuffers, sizeof(uintptr_t));89 if ( bufs->buf_phys == NULL)77 stream->buf = calloc(stream->nbuffers, sizeof(void *)); 78 if (stream->buf == NULL) 79 goto error; 80 81 stream->buf_phys = calloc(stream->nbuffers, sizeof(uintptr_t)); 82 if (stream->buf_phys == NULL) 90 83 goto error; 91 84 92 85 /* Allocate buffers */ 93 86 /* 94 for (i = 0; i < bufs->nbuffers; i++) {87 for (i = 0; i < stream->nbuffers; i++) { 95 88 buffer = AS_AREA_ANY; 96 rc = dmamem_map_anonymous( bufs->bufsize,97 bufs->hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE,89 rc = dmamem_map_anonymous(stream->bufsize, 90 stream->hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 98 91 0, &buffer_phys, &buffer); 99 92 if (rc != EOK) … … 103 96 (unsigned long long)buffer_phys, buffer); 104 97 105 bufs->buf[i] = buffer;106 bufs->buf_phys[i] = buffer_phys;98 stream->buf[i] = buffer; 99 stream->buf_phys[i] = buffer_phys; 107 100 108 101 k = 0; 109 for (j = 0; j < bufs->bufsize / 2; j++) {110 int16_t *bp = bufs->buf[i];102 for (j = 0; j < stream->bufsize / 2; j++) { 103 int16_t *bp = stream->buf[i]; 111 104 bp[j] = (k > 128) ? -100 : 100; 112 105 ++k; … … 118 111 /* audio_pcm_iface requires a single contiguous buffer */ 119 112 buffer = AS_AREA_ANY; 120 rc = dmamem_map_anonymous( bufs->bufsize * bufs->nbuffers,121 hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE,113 rc = dmamem_map_anonymous(stream->bufsize * stream->nbuffers, 114 stream->hda->ctl->ok64bit ? 0 : DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 122 115 0, &buffer_phys, &buffer); 123 116 if (rc != EOK) { … … 126 119 } 127 120 128 for (i = 0; i < bufs->nbuffers; i++) {129 bufs->buf[i] = buffer + i * bufs->bufsize;130 bufs->buf_phys[i] = buffer_phys + i * bufs->bufsize;121 for (i = 0; i < stream->nbuffers; i++) { 122 stream->buf[i] = buffer + i * stream->bufsize; 123 stream->buf_phys[i] = buffer_phys + i * stream->bufsize; 131 124 132 125 ddf_msg(LVL_NOTE, "Stream buf phys=0x%llx virt=%p", 133 (long long unsigned)(uintptr_t) bufs->buf[i],134 (void *) bufs->buf_phys[i]);126 (long long unsigned)(uintptr_t)stream->buf[i], 127 (void *)stream->buf_phys[i]); 135 128 /* k = 0; 136 for (j = 0; j < bufs->bufsize / 2; j++) {137 int16_t *bp = bufs->buf[i];129 for (j = 0; j < stream->bufsize / 2; j++) { 130 int16_t *bp = stream->buf[i]; 138 131 bp[j] = (k > 128) ? -10000 : 10000; 139 132 ++k; … … 145 138 146 139 /* Fill in BDL */ 147 for (i = 0; i < bufs->nbuffers; i++) { 148 bufs->bdl[i].address = host2uint64_t_le(bufs->buf_phys[i]); 149 bufs->bdl[i].length = host2uint32_t_le(bufs->bufsize); 150 bufs->bdl[i].flags = BIT_V(uint32_t, bdf_ioc); 151 } 152 153 *rbufs = bufs; 140 for (i = 0; i < stream->nbuffers; i++) { 141 stream->bdl[i].address = host2uint64_t_le(stream->buf_phys[i]); 142 stream->bdl[i].length = host2uint32_t_le(stream->bufsize); 143 stream->bdl[i].flags = BIT_V(uint32_t, bdf_ioc); 144 } 145 154 146 return EOK; 155 147 error: 156 hda_stream_buffers_free(bufs);157 148 return ENOMEM; 158 149 } 159 150 160 void hda_stream_buffers_free(hda_stream_buffers_t *bufs)161 {162 if (bufs == NULL)163 return;164 165 /* XXX */166 free(bufs);167 }168 169 151 static void hda_stream_desc_configure(hda_stream_t *stream) 170 152 { 171 153 hda_sdesc_regs_t *sdregs; 172 hda_stream_buffers_t *bufs = stream->buffers;173 154 uint8_t ctl1; 174 155 uint8_t ctl3; … … 180 161 hda_reg8_write(&sdregs->ctl3, ctl3); 181 162 hda_reg8_write(&sdregs->ctl1, ctl1); 182 hda_reg32_write(&sdregs->cbl, bufs->nbuffers * bufs->bufsize);183 hda_reg16_write(&sdregs->lvi, bufs->nbuffers - 1);163 hda_reg32_write(&sdregs->cbl, stream->nbuffers * stream->bufsize); 164 hda_reg16_write(&sdregs->lvi, stream->nbuffers - 1); 184 165 hda_reg16_write(&sdregs->fmt, stream->fmt); 185 hda_reg32_write(&sdregs->bdpl, LOWER32( bufs->bdl_phys));186 hda_reg32_write(&sdregs->bdpu, UPPER32( bufs->bdl_phys));166 hda_reg32_write(&sdregs->bdpl, LOWER32(stream->bdl_phys)); 167 hda_reg32_write(&sdregs->bdpu, UPPER32(stream->bdl_phys)); 187 168 } 188 169 … … 224 205 225 206 hda_stream_t *hda_stream_create(hda_t *hda, hda_stream_dir_t dir, 226 hda_stream_buffers_t *bufs,uint32_t fmt)207 uint32_t fmt) 227 208 { 228 209 hda_stream_t *stream; 229 uint8_t sdid;210 int rc; 230 211 231 212 stream = calloc(1, sizeof(hda_stream_t)); … … 233 214 return NULL; 234 215 235 sdid = 0;236 237 switch (dir) {238 case sdir_input:239 sdid = 0; /* XXX Allocate - first input SDESC */240 break;241 case sdir_output:242 sdid = hda->ctl->iss; /* XXX Allocate - First output SDESC */243 break;244 case sdir_bidi:245 sdid = hda->ctl->iss + hda->ctl->oss; /* XXX Allocate - First bidi SDESC */246 break;247 }248 249 216 stream->hda = hda; 250 217 stream->dir = dir; 251 218 stream->sid = 1; /* XXX Allocate this */ 252 stream->sdid = sdid;219 stream->sdid = hda->ctl->iss; /* XXX Allocate - First output SDESC */ 253 220 stream->fmt = fmt; 254 stream->buffers = bufs;255 221 256 222 ddf_msg(LVL_NOTE, "snum=%d sdidx=%d", stream->sid, stream->sdid); 223 224 ddf_msg(LVL_NOTE, "Allocate buffers"); 225 rc = hda_stream_buffers_alloc(stream); 226 if (rc != EOK) 227 goto error; 257 228 258 229 ddf_msg(LVL_NOTE, "Configure stream descriptor"); 259 230 hda_stream_desc_configure(stream); 260 231 return stream; 232 error: 233 return NULL; 261 234 } 262 235 -
uspace/drv/audio/hdaudio/stream.h
r94e46c9 ra25d893 48 48 } hda_stream_dir_t; 49 49 50 typedef struct hda_stream_buffers { 50 typedef struct hda_stream { 51 hda_t *hda; 52 /** Stream ID */ 53 uint8_t sid; 54 /** Stream descriptor index */ 55 uint8_t sdid; 56 /** Direction */ 57 hda_stream_dir_t dir; 51 58 /** Number of buffers */ 52 59 size_t nbuffers; … … 61 68 /** Physical addresses of buffers */ 62 69 uintptr_t *buf_phys; 63 } hda_stream_buffers_t;64 65 typedef struct hda_stream {66 hda_t *hda;67 /** Stream ID */68 uint8_t sid;69 /** Stream descriptor index */70 uint8_t sdid;71 /** Direction */72 hda_stream_dir_t dir;73 /** Buffers */74 hda_stream_buffers_t *buffers;75 70 /** Stream format */ 76 71 uint32_t fmt; 77 72 } hda_stream_t; 78 73 79 extern int hda_stream_buffers_alloc(hda_t *, hda_stream_buffers_t **); 80 extern void hda_stream_buffers_free(hda_stream_buffers_t *); 81 extern hda_stream_t *hda_stream_create(hda_t *, hda_stream_dir_t, 82 hda_stream_buffers_t *, uint32_t); 74 extern hda_stream_t *hda_stream_create(hda_t *, hda_stream_dir_t, uint32_t); 83 75 extern void hda_stream_destroy(hda_stream_t *); 84 76 extern void hda_stream_start(hda_stream_t *); -
uspace/drv/block/ata_bd/main.c
r94e46c9 ra25d893 81 81 rc = EINVAL; 82 82 goto error; 83 return EINVAL; 83 84 } 84 85 -
uspace/drv/bus/isa/isa.c
r94e46c9 ra25d893 245 245 bool opened = false; 246 246 int fd; 247 size_t len; 248 ssize_t r; 247 size_t len = 0; 249 248 250 249 fd = open(conf_path, O_RDONLY); … … 270 269 } 271 270 272 r = read_all(fd, buf, len); 273 if (r < 0) { 271 if (0 >= read(fd, buf, len)) { 274 272 ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path); 275 273 goto cleanup; -
uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
r94e46c9 ra25d893 282 282 return ret; 283 283 } 284 if (dispc->fb_data)285 dmamem_unmap_anonymous(dispc->fb_data);286 284 287 dispc->fb_data = buffer;288 285 amdm37x_dispc_setup_fb(dispc->regs, x, y, bpp *8, (uint32_t)pa); 289 286 dispc->active_fb.idx = mode.index; … … 293 290 dispc->active_fb.bpp = bpp; 294 291 dispc->active_fb.pixel2visual = p2v; 292 dispc->fb_data = buffer; 295 293 dispc->size = size; 296 294 assert(mode.index < 1); 297 295 296 if (dispc->fb_data) 297 dmamem_unmap_anonymous(dispc->fb_data); 298 298 return EOK; 299 299 } -
uspace/lib/c/generic/dhcp.c
r94e46c9 ra25d893 84 84 } 85 85 86 int dhcp_discover(sysarg_t link_id)87 {88 async_exch_t *exch = async_exchange_begin(dhcp_sess);89 90 int rc = async_req_1_0(exch, DHCP_DISCOVER, link_id);91 async_exchange_end(exch);92 93 return rc;94 }95 96 86 /** @} 97 87 */ -
uspace/lib/c/generic/irq.c
r94e46c9 ra25d893 35 35 #include <ipc/irq.h> 36 36 #include <libc.h> 37 #include <stdlib.h>38 #include <macros.h>39 40 static irq_cmd_t default_cmds[] = {41 {42 .cmd = CMD_ACCEPT43 }44 };45 46 static const irq_code_t default_ucode = {47 0,48 NULL,49 ARRAY_SIZE(default_cmds),50 default_cmds51 };52 37 53 38 /** Subscribe to IRQ notification. … … 64 49 const irq_code_t *ucode) 65 50 { 66 if (ucode == NULL)67 ucode = &default_ucode;68 69 51 return __SYSCALL4(SYS_IPC_IRQ_SUBSCRIBE, inr, devno, method, 70 52 (sysarg_t) ucode); -
uspace/lib/c/include/inet/dhcp.h
r94e46c9 ra25d893 41 41 extern int dhcp_link_add(sysarg_t); 42 42 extern int dhcp_link_remove(sysarg_t); 43 extern int dhcp_discover(sysarg_t);44 43 45 44 #endif -
uspace/lib/c/include/ipc/dev_iface.h
r94e46c9 ra25d893 48 48 /** Network interface controller interface */ 49 49 NIC_DEV_IFACE, 50 51 /** IEEE 802.11 interface controller interface */52 IEEE80211_DEV_IFACE,53 50 54 51 /** Interface provided by any PCI device. */ -
uspace/lib/c/include/ipc/dhcp.h
r94e46c9 ra25d893 41 41 typedef enum { 42 42 DHCP_LINK_ADD = IPC_FIRST_USER_METHOD, 43 DHCP_LINK_REMOVE, 44 DHCP_DISCOVER 43 DHCP_LINK_REMOVE 45 44 } dhcp_request_t; 46 45 -
uspace/lib/drv/Makefile
r94e46c9 ra25d893 48 48 generic/remote_char_dev.c \ 49 49 generic/remote_nic.c \ 50 generic/remote_ieee80211.c \51 50 generic/remote_usb.c \ 52 51 generic/remote_pci.c \ -
uspace/lib/drv/generic/dev_iface.c
r94e46c9 ra25d893 46 46 #include "remote_battery_dev.h" 47 47 #include "remote_nic.h" 48 #include "remote_ieee80211.h"49 48 #include "remote_usb.h" 50 49 #include "remote_usbhc.h" … … 63 62 [CHAR_DEV_IFACE] = &remote_char_dev_iface, 64 63 [NIC_DEV_IFACE] = &remote_nic_iface, 65 [IEEE80211_DEV_IFACE] = &remote_ieee80211_iface,66 64 [PCI_DEV_IFACE] = &remote_pci_iface, 67 65 [USB_DEV_IFACE] = &remote_usb_iface, -
uspace/lib/drv/generic/interrupt.c
r94e46c9 ra25d893 44 44 #include "private/driver.h" 45 45 46 static irq_cmd_t default_cmds[] = { 47 { 48 .cmd = CMD_ACCEPT 49 } 50 }; 51 52 static const irq_code_t default_pseudocode = { 53 0, 54 NULL, 55 ARRAY_SIZE(default_cmds), 56 default_cmds 57 }; 58 46 59 int register_interrupt_handler(ddf_dev_t *dev, int irq, 47 60 interrupt_handler_t *handler, const irq_code_t *pseudocode) -
uspace/lib/ext4/libext4_directory.c
r94e46c9 ra25d893 390 390 (ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) { 391 391 int rc = ext4_directory_dx_add_entry(parent, child, name); 392 392 393 393 /* Check if index is not corrupted */ 394 if (rc != EXT4_ERR_BAD_DX_DIR) 395 return rc; 396 394 if (rc != EXT4_ERR_BAD_DX_DIR) { 395 if (rc != EOK) 396 return rc; 397 398 return EOK; 399 } 400 397 401 /* Needed to clear dir index flag if corrupted */ 398 402 ext4_inode_clear_flag(parent->inode, EXT4_INODE_FLAG_INDEX); -
uspace/lib/ext4/libext4_extent.c
r94e46c9 ra25d893 797 797 if (rc != EOK) { 798 798 ext4_balloc_free_block(inode_ref, fblock); 799 block_put(block);800 799 return rc; 801 800 } -
uspace/lib/ext4/libext4_filesystem.c
r94e46c9 ra25d893 53 53 enum cache_mode cmode) 54 54 { 55 ext4_superblock_t *temp_superblock = NULL;56 57 55 fs->device = service_id; 58 56 59 57 /* Initialize block library (4096 is size of communication channel) */ 60 58 int rc = block_init(EXCHANGE_SERIALIZE, fs->device, 4096); 61 59 if (rc != EOK) 62 goto err;63 60 return rc; 61 64 62 /* Read superblock from device to memory */ 63 ext4_superblock_t *temp_superblock; 65 64 rc = ext4_superblock_read_direct(fs->device, &temp_superblock); 66 if (rc != EOK) 67 goto err_1; 68 65 if (rc != EOK) { 66 block_fini(fs->device); 67 return rc; 68 } 69 69 70 /* Read block size from superblock and check */ 70 71 uint32_t block_size = ext4_superblock_get_block_size(temp_superblock); 71 72 if (block_size > EXT4_MAX_BLOCK_SIZE) { 72 rc = ENOTSUP;73 goto err_1;74 } 75 73 block_fini(fs->device); 74 return ENOTSUP; 75 } 76 76 77 /* Initialize block caching by libblock */ 77 78 rc = block_cache_init(service_id, block_size, 0, cmode); 78 if (rc != EOK) 79 goto err_1; 80 79 if (rc != EOK) { 80 block_fini(fs->device); 81 return rc; 82 } 83 81 84 /* Compute limits for indirect block levels */ 82 85 uint32_t block_ids_per_block = block_size / sizeof(uint32_t); … … 89 92 fs->inode_blocks_per_level[i]; 90 93 } 91 94 92 95 /* Return loaded superblock */ 93 96 fs->superblock = temp_superblock; 94 97 95 98 uint16_t state = ext4_superblock_get_state(fs->superblock); 96 99 97 100 if (((state & EXT4_SUPERBLOCK_STATE_VALID_FS) != 98 101 EXT4_SUPERBLOCK_STATE_VALID_FS) || 99 102 ((state & EXT4_SUPERBLOCK_STATE_ERROR_FS) == 100 103 EXT4_SUPERBLOCK_STATE_ERROR_FS)) { 101 rc = ENOTSUP; 102 goto err_2; 103 } 104 104 block_cache_fini(fs->device); 105 block_fini(fs->device); 106 return ENOTSUP; 107 } 108 105 109 /* Mark system as mounted */ 106 110 ext4_superblock_set_state(fs->superblock, EXT4_SUPERBLOCK_STATE_ERROR_FS); 107 111 rc = ext4_superblock_write_direct(fs->device, fs->superblock); 108 if (rc != EOK) 109 goto err_2; 110 112 if (rc != EOK) { 113 block_cache_fini(fs->device); 114 block_fini(fs->device); 115 return rc; 116 } 117 111 118 uint16_t mnt_count = ext4_superblock_get_mount_count(fs->superblock); 112 119 ext4_superblock_set_mount_count(fs->superblock, mnt_count + 1); 113 120 114 121 return EOK; 115 116 err_2:117 block_cache_fini(fs->device);118 err_1:119 block_fini(fs->device);120 err:121 if (temp_superblock)122 ext4_superblock_release(temp_superblock);123 return rc;124 122 } 125 123 … … 847 845 848 846 rc = block_put(subblock); 849 if (rc != EOK) { 850 block_put(block); 847 if (rc != EOK) 851 848 return rc; 852 }853 849 } 854 850 -
uspace/lib/ext4/libext4_superblock.c
r94e46c9 ra25d893 1178 1178 } 1179 1179 1180 /** Release the memory allocated for the superblock structure1181 *1182 * @param sb Superblock to be freed1183 *1184 */1185 void ext4_superblock_release(ext4_superblock_t *sb)1186 {1187 free(sb);1188 }1189 1190 1180 /** Check sanity of the superblock. 1191 1181 * -
uspace/lib/ext4/libext4_superblock.h
r94e46c9 ra25d893 145 145 extern int ext4_superblock_read_direct(service_id_t, ext4_superblock_t **); 146 146 extern int ext4_superblock_write_direct(service_id_t, ext4_superblock_t *); 147 extern void ext4_superblock_release(ext4_superblock_t *);148 147 extern int ext4_superblock_check_sanity(ext4_superblock_t *); 149 148 -
uspace/srv/devman/drv_conn.c
r94e46c9 ra25d893 173 173 callid = async_get_call(&call); 174 174 if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) { 175 log_msg(LOG_DEFAULT, LVL_ERROR, 175 log_msg(LOG_DEFAULT, LVL_ERROR, 176 176 "Invalid protocol when trying to receive match id."); 177 async_answer_0(callid, EINVAL); 177 async_answer_0(callid, EINVAL); 178 178 delete_match_id(match_id); 179 179 return EINVAL; … … 246 246 if (ftype != fun_inner && ftype != fun_exposed) { 247 247 /* Unknown function type */ 248 log_msg(LOG_DEFAULT, LVL_ERROR, 248 log_msg(LOG_DEFAULT, LVL_ERROR, 249 249 "Unknown function type %d provided by driver.", 250 250 (int) ftype); … … 404 404 fibril_rwlock_read_unlock(&device_tree.rwlock); 405 405 406 rc = fun_o nline(fun);406 rc = fun_offline(fun); 407 407 if (rc != EOK) { 408 408 fun_busy_unlock(fun); -
uspace/srv/devman/fun.c
r94e46c9 ra25d893 348 348 loc_register_tree_function(fun, &device_tree); 349 349 350 fun->state = FUN_ON_LINE;351 350 fibril_rwlock_write_unlock(&device_tree.rwlock); 352 351 -
uspace/srv/locsrv/locsrv.c
r94e46c9 ra25d893 1357 1357 cat = category_new("nic"); 1358 1358 categ_dir_add_cat(&cdir, cat); 1359 1360 cat = category_new("ieee80211");1361 categ_dir_add_cat(&cdir, cat);1362 1359 1363 1360 cat = category_new("visualizer"); -
uspace/srv/net/dhcp/dhcp.c
r94e46c9 ra25d893 418 418 } 419 419 420 static int dhcp_discover_proc(dhcp_link_t *dlink)421 {422 dlink->state = ds_selecting;423 424 int rc = dhcp_send_discover(dlink);425 if (rc != EOK)426 return EIO;427 428 dlink->retries_left = dhcp_discover_retries;429 430 if ((dlink->timeout->state == fts_not_set) ||431 (dlink->timeout->state == fts_fired))432 fibril_timer_set(dlink->timeout, dhcp_discover_timeout_val,433 dhcpsrv_discover_timeout, dlink);434 435 return rc;436 }437 438 420 int dhcpsrv_link_add(service_id_t link_id) 439 421 { … … 477 459 } 478 460 461 dlink->state = ds_selecting; 462 479 463 log_msg(LOG_DEFAULT, LVL_DEBUG, "Send DHCPDISCOVER"); 480 rc = dhcp_ discover_proc(dlink);464 rc = dhcp_send_discover(dlink); 481 465 if (rc != EOK) { 482 466 log_msg(LOG_DEFAULT, LVL_ERROR, "Error sending DHCPDISCOVER."); … … 485 469 goto error; 486 470 } 471 472 dlink->retries_left = dhcp_discover_retries; 473 fibril_timer_set(dlink->timeout, dhcp_discover_timeout_val, 474 dhcpsrv_discover_timeout, dlink); 487 475 488 476 list_append(&dlink->links, &dhcp_links); … … 501 489 } 502 490 503 int dhcpsrv_discover(service_id_t link_id)504 {505 log_msg(LOG_DEFAULT, LVL_DEBUG, "dhcpsrv_link_add(%zu)", link_id);506 507 dhcp_link_t *dlink = dhcpsrv_link_find(link_id);508 509 if (dlink == NULL) {510 log_msg(LOG_DEFAULT, LVL_NOTE, "Link %zu doesn't exist",511 link_id);512 return EINVAL;513 }514 515 return dhcp_discover_proc(dlink);516 }517 518 491 static void dhcpsrv_recv_offer(dhcp_link_t *dlink, dhcp_offer_t *offer) 519 492 { … … 561 534 return; 562 535 } 563 564 /* XXX Work around multiple simultaneous sessions issue */565 dhcp_transport_fini(&dlink->dt);566 536 567 537 log_msg(LOG_DEFAULT, LVL_NOTE, "%s: Successfully configured.", -
uspace/srv/net/dhcp/dhcp.h
r94e46c9 ra25d893 43 43 extern int dhcpsrv_link_add(service_id_t); 44 44 extern int dhcpsrv_link_remove(service_id_t); 45 extern int dhcpsrv_discover(service_id_t);46 45 47 46 #endif -
uspace/srv/net/dhcp/main.c
r94e46c9 ra25d893 109 109 } 110 110 111 static void dhcp_discover_srv(ipc_callid_t callid, ipc_call_t *call)112 {113 sysarg_t link_id;114 int rc;115 116 log_msg(LOG_DEFAULT, LVL_DEBUG, "dhcp_discover_srv()");117 118 link_id = IPC_GET_ARG1(*call);119 120 rc = dhcpsrv_discover(link_id);121 async_answer_0(callid, rc);122 }123 124 111 static void dhcp_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 125 112 { … … 146 133 case DHCP_LINK_REMOVE: 147 134 dhcp_link_remove_srv(callid, &call); 148 break;149 case DHCP_DISCOVER:150 dhcp_discover_srv(callid, &call);151 135 break; 152 136 default: -
uspace/srv/net/dhcp/transport.c
r94e46c9 ra25d893 95 95 int rc; 96 96 97 if (dt->fd < 0) {98 /* Terminated */99 return EIO;100 }101 102 97 src_addr_size = sizeof(src_addr); 103 98 rc = recvfrom(dt->fd, msgbuf, MAX_MSG_SIZE, 0, … … 171 166 { 172 167 closesocket(dt->fd); 173 dt->fd = -1;174 168 } 175 169
Note:
See TracChangeset
for help on using the changeset viewer.