Changes in / [d7b7f5e:1c0cef0] in mainline


Ignore:
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/include/arch/asm.h

    rd7b7f5e r1c0cef0  
    4242NO_TRACE static inline void cpu_sleep(void)
    4343{
    44         /*
    45          * Unfortunatelly most of the simulators do not support
    46          *
    47          * asm volatile (
    48          *     "wait"
    49          * );
    50          *
    51          */
     44        asm volatile ("wait");
    5245}
    5346
  • kernel/generic/src/debug/panic.c

    rd7b7f5e r1c0cef0  
    9696        printf("THE=%p: ", THE);
    9797        if (THE != NULL) {
    98                 printf("pe=%" PRIun " thr=%p task=%p cpu=%p as=%p"
     98                printf("pd=%" PRIun " thread=%p task=%p cpu=%p as=%p"
    9999                    " magic=%#" PRIx32 "\n", THE->preemption_disabled,
    100100                    THE->thread, THE->task, THE->cpu, THE->as, THE->magic);
     101               
     102                if (THE->thread != NULL)
     103                        printf("thread=\"%s\"\n", THE->thread->name);
     104               
     105                if (THE->task != NULL)
     106                        printf("task=\"%s\"\n", THE->task->name);
    101107        } else
    102108                printf("invalid\n");
  • kernel/generic/src/mm/frame.c

    rd7b7f5e r1c0cef0  
    443443NO_TRACE static void zone_mark_unavailable(zone_t *zone, size_t index)
    444444{
    445         if (!(zone->flags & ZONE_AVAILABLE))
    446                 return;
     445        ASSERT(zone->flags & ZONE_AVAILABLE);
    447446       
    448447        frame_t *frame = zone_get_frame(zone, index);
  • uspace/app/netspeed/netspeed.c

    rd7b7f5e r1c0cef0  
    6363
    6464        int listen_sd = socket(PF_INET, sock_type, 0);
    65         if (listen_sd < 0)
     65        if (listen_sd < 0) {
    6666                fprintf(stderr, "socket failed: %s\n", str_error(rc));
    6767                return rc;
     68        }
    6869       
    6970        rc = bind(listen_sd, (struct sockaddr *) &addr, sizeof(addr));
     
    9293                        return conn_sd;
    9394                }
    94         }
    95         else {
     95        } else {
    9696                conn_sd = listen_sd;
    9797        }
     
    150150                if (sock_type == SOCK_STREAM) {
    151151                        rc = send(conn_sd, buf, bufsize, 0);
    152                 }
    153                 else {
     152                } else {
    154153                        rc = sendto(conn_sd, buf, bufsize, 0,
    155154                            (struct sockaddr *) &addr, sizeof(addr));
     
    181180        if (str_cmp(argv[1], "tcp") == 0) {
    182181                sock_type = SOCK_STREAM;
    183         }
    184         else if (str_cmp(argv[1], "udp") == 0) {
     182        } else if (str_cmp(argv[1], "udp") == 0) {
    185183                sock_type = SOCK_DGRAM;
    186         }
    187         else {
     184        } else {
    188185                fprintf(stderr, "Invalid socket type\n");
    189186                syntax_print();
     
    266263                if (rc != EOK)
    267264                        fprintf(stderr, "Server failed: %s\n", str_error(rc));
    268         }
    269         else {
     265        } else {
    270266                rc = client(sock_type, address, port, count, buf, bufsize);
    271267                if (rc != EOK)
  • uspace/app/wavplay/dplay.c

    rd7b7f5e r1c0cef0  
    151151            device_event_callback, pb);
    152152        if (ret != EOK) {
    153                 printf("Failed to register event callback.\n");
     153                printf("Failed to register event callback: %s.\n",
     154                    str_error(ret));
    154155                return;
    155156        }
     
    285286                            pb->f.sample_format);
    286287                        if (ret != EOK) {
    287                                 printf("Failed to start playback\n");
     288                                printf("Failed to start playback: %s\n",
     289                                    str_error(ret));
    288290                                return;
    289291                        }
     
    291293                        ret = audio_pcm_get_buffer_pos(pb->device, &pos);
    292294                        if (ret != EOK) {
    293                                 printf("Failed to update position indicator\n");
     295                                printf("Failed to update position indicator "
     296                                   "%s\n", str_error(ret));
    294297                        }
    295298                }
     
    308311                const int ret = audio_pcm_get_buffer_pos(pb->device, &pos);
    309312                if (ret != EOK) {
    310                         printf("Failed to update position indicator\n");
     313                        printf("Failed to update position indicator %s\n",
     314                            str_error(ret));
    311315                }
    312316                getuptime(&time);
     
    350354        ret = audio_pcm_get_info_str(session, &info);
    351355        if (ret != EOK) {
    352                 printf("Failed to get PCM info.\n");
     356                printf("Failed to get PCM info: %s.\n", str_error(ret));
    353357                goto close_session;
    354358        }
  • uspace/app/wavplay/main.c

    rd7b7f5e r1c0cef0  
    7979            &format.sampling_rate, &format.sample_format, &error);
    8080        if (ret != EOK) {
    81                 printf("Error parsing wav header: %s.\n", error);
     81                printf("Error parsing `%s' wav header: %s.\n", filename, error);
    8282                fclose(source);
    8383                return EINVAL;
    8484        }
     85
     86        printf("File `%s' format: %u channel(s), %uHz, %s.\n", filename,
     87            format.channels, format.sampling_rate,
     88            pcm_sample_format_str(format.sample_format));
    8589
    8690        /* Allocate buffer and create new context */
     
    136140            &format.sampling_rate, &format.sample_format, &error);
    137141        if (ret != EOK) {
    138                 printf("Error parsing wav header: %s.\n", error);
     142                printf("Error parsing `%s' wav header: %s.\n", filename, error);
    139143                fclose(source);
    140144                return EINVAL;
    141145        }
     146        printf("File `%s' format: %u channel(s), %uHz, %s.\n", filename,
     147            format.channels, format.sampling_rate,
     148            pcm_sample_format_str(format.sample_format));
    142149
    143150        /* Connect new playback context */
  • uspace/app/wavplay/wave.c

    rd7b7f5e r1c0cef0  
    8181        }
    8282
    83         if (uint16_t_le2host(header->subchunk1_size) != PCM_SUBCHUNK1_SIZE) {
     83        if (uint32_t_le2host(header->subchunk1_size) != PCM_SUBCHUNK1_SIZE) {
     84                //TODO subchunk 1 sizes other than 16 are allowed ( 18, 40)
     85                //http://www-mmsp.ece.mcgill.ca/documents/AudioFormats/WAVE/WAVE.html
    8486                if (error)
    8587                        *error = "invalid subchunk1 size";
    86                 return EINVAL;
     88//              return EINVAL;
    8789        }
    8890
     
    9496
    9597        if (str_lcmp(header->subchunk2_id, SUBCHUNK2_ID, 4) != 0) {
     98                //TODO basedd on subchunk1 size, we might be reading wrong
     99                //offset
    96100                if (error)
    97101                        *error = "invalid subchunk2 id";
    98                 return EINVAL;
     102//              return EINVAL;
    99103        }
    100104
    101105
     106        //TODO data and data_size are incorrect in extended wav formats
     107        //pcm params are OK
    102108        if (data)
    103109                *data = header->data;
  • uspace/lib/gui/window.c

    rd7b7f5e r1c0cef0  
    6666
    6767static pixel_t border_color = PIXEL(255, 0, 0, 0);
    68 static pixel_t header_bg_focus_color = PIXEL(255, 25, 25, 112);
     68static pixel_t header_bg_focus_color = PIXEL(255, 88, 106, 196);
    6969static pixel_t header_fg_focus_color = PIXEL(255, 255, 255, 255);
    70 static pixel_t header_bg_unfocus_color = PIXEL(255, 70, 130, 180);
     70static pixel_t header_bg_unfocus_color = PIXEL(255, 12, 57, 92);
    7171static pixel_t header_fg_unfocus_color = PIXEL(255, 255, 255, 255);
    7272
  • uspace/srv/audio/hound/audio_device.c

    rd7b7f5e r1c0cef0  
    162162                }
    163163                audio_pcm_register_event_callback(dev->sess,
    164                     device_event_callback, dev);\
     164                    device_event_callback, dev);
    165165
    166166                /* Fill the buffer first. Fill the first two fragments,
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    rd7b7f5e r1c0cef0  
    876876        if (rc != EOK)
    877877                return rc;
    878         if (NULL == inst)
    879                 return ENOENT;
    880878
    881879        ext4_superblock_t *sb = inst->filesystem->superblock;
  • uspace/srv/fs/mfs/mfs.h

    rd7b7f5e r1c0cef0  
    4444#include <errno.h>
    4545#include <assert.h>
     46#include <stdbool.h>
    4647#include "../../vfs/vfs.h"
    4748
     
    105106        unsigned isearch;
    106107        unsigned zsearch;
     108
     109        /* Indicates wether if the cached number of free zones
     110         * is to be considered valid or not.
     111         */
     112        bool nfree_zones_valid;
     113        /* Cached number of free zones, used to avoid to scan
     114         * the whole bitmap every time the mfs_free_block_count()
     115         * is invoked.
     116         */
     117        unsigned nfree_zones;
    107118};
    108119
  • uspace/srv/fs/mfs/mfs_balloc.c

    rd7b7f5e r1c0cef0  
    8888{
    8989        int r = mfs_alloc_bit(inst, zone, BMAP_ZONE);
     90        if (r != EOK)
     91                return r;
     92
     93        /* Update the cached number of free zones */
     94        struct mfs_sb_info *sbi = inst->sbi;
     95        if (sbi->nfree_zones_valid)
     96                sbi->nfree_zones--;
    9097
    9198        *zone += inst->sbi->firstdatazone - 1;
     
    103110mfs_free_zone(struct mfs_instance *inst, uint32_t zone)
    104111{
     112        int r;
     113
    105114        zone -= inst->sbi->firstdatazone - 1;
    106115
    107         return mfs_free_bit(inst, zone, BMAP_ZONE);
     116        r = mfs_free_bit(inst, zone, BMAP_ZONE);
     117        if (r != EOK)
     118                return r;
     119
     120        /* Update the cached number of free zones */
     121        struct mfs_sb_info *sbi = inst->sbi;
     122        if (sbi->nfree_zones_valid)
     123                sbi->nfree_zones++;
     124
     125        return r;
    108126}
    109127
  • uspace/srv/fs/mfs/mfs_ops.c

    rd7b7f5e r1c0cef0  
    216216        sbi->isearch = 0;
    217217        sbi->zsearch = 0;
     218        sbi->nfree_zones_valid = false;
     219        sbi->nfree_zones = 0;
    218220
    219221        if (version == MFS_VERSION_V3) {
     
    11811183                return rc;
    11821184
    1183         if (NULL == inst)
    1184                 return ENOENT;
    1185 
    1186         mfs_count_free_zones(inst, &block_free);
    1187         *count = block_free;
    1188 
    1189         return EOK;
     1185        struct mfs_sb_info *sbi = inst->sbi;
     1186
     1187        if (!sbi->nfree_zones_valid) {
     1188                /* The cached number of free zones is not valid,
     1189                 * we need to scan the bitmap to retrieve the
     1190                 * current value.
     1191                 */
     1192
     1193                rc = mfs_count_free_zones(inst, &block_free);
     1194                if (rc != EOK)
     1195                        return rc;
     1196
     1197                sbi->nfree_zones = block_free;
     1198                sbi->nfree_zones_valid = true;
     1199        }
     1200
     1201        *count = sbi->nfree_zones;
     1202
     1203        return rc;
    11901204}
    11911205
  • uspace/srv/hid/compositor/compositor.c

    rd7b7f5e r1c0cef0  
    21762176       
    21772177        /* Color of the viewport background. Must be opaque. */
    2178         bg_color = PIXEL(255, 75, 70, 75);
     2178        bg_color = PIXEL(255, 69, 51, 103);
    21792179       
    21802180        /* Register compositor server. */
Note: See TracChangeset for help on using the changeset viewer.