/branches/tracing/uspace/app/tester/tester.c |
---|
56,6 → 56,7 |
#include "ipc/answer.def" |
#include "ipc/hangup.def" |
#include "devmap/devmap1.def" |
#include "loop/loop1.def" |
#include "vfs/vfs1.def" |
#include "debug/debug1.def" |
{NULL, NULL, NULL} |
/branches/tracing/uspace/app/tester/loop/loop1.def |
---|
0,0 → 1,6 |
{ |
"loop1", |
"Endless loop", |
&test_loop1, |
false |
}, |
/branches/tracing/uspace/app/tester/loop/loop1.c |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include "../tester.h" |
char *test_loop1(bool quiet) |
{ |
printf("Looping...\n"); |
while (1); |
printf("Survived endless loop?!!\n"); |
return NULL; |
} |
/branches/tracing/uspace/app/tester/tester.h |
---|
69,6 → 69,7 |
extern char * test_answer(bool quiet); |
extern char * test_hangup(bool quiet); |
extern char * test_devmap1(bool quiet); |
extern char * test_loop1(bool quiet); |
extern char * test_vfs1(bool quiet); |
extern char * test_debug1(bool quiet); |
/branches/tracing/uspace/app/tester/Makefile |
---|
54,6 → 54,7 |
ipc/send_sync.c \ |
ipc/answer.c \ |
ipc/hangup.c \ |
loop/loop1.c \ |
devmap/devmap1.c \ |
vfs/vfs1.c \ |
debug/debug1.c |
/branches/tracing/uspace/srv/fs/fat/fat.h |
---|
204,6 → 204,7 |
extern void fat_write(ipc_callid_t, ipc_call_t *); |
extern void fat_truncate(ipc_callid_t, ipc_call_t *); |
extern fat_idx_t *fat_idx_get_new(dev_handle_t); |
extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned); |
extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t); |
/branches/tracing/uspace/srv/fs/fat/fat_ops.c |
---|
234,22 → 234,61 |
static void fat_node_put(void *node) |
{ |
fat_node_t *nodep = (fat_node_t *)node; |
bool destroy = false; |
futex_down(&nodep->lock); |
if (!--nodep->refcnt) { |
if (nodep->idx) { |
futex_down(&ffn_futex); |
list_append(&nodep->ffn_link, &ffn_head); |
futex_up(&ffn_futex); |
} else { |
/* |
* The node does not have any index structure associated |
* with itself. This can only mean that we are releasing |
* the node after a failed attempt to allocate the index |
* structure for it. |
*/ |
destroy = true; |
} |
} |
futex_up(&nodep->lock); |
if (destroy) |
free(node); |
} |
static void *fat_create(dev_handle_t dev_handle, int flags) |
static void *fat_create_node(dev_handle_t dev_handle, int flags) |
{ |
return NULL; /* not supported at the moment */ |
fat_idx_t *idxp; |
fat_node_t *nodep; |
nodep = fat_node_get_new(); |
if (!nodep) |
return NULL; |
idxp = fat_idx_get_new(dev_handle); |
if (!idxp) { |
fat_node_put(nodep); |
return NULL; |
} |
/* idxp->lock held */ |
if (flags & L_DIRECTORY) { |
nodep->type = FAT_DIRECTORY; |
} else { |
nodep->type = FAT_FILE; |
} |
nodep->size = 0; |
nodep->firstc = FAT_CLST_RES0; |
nodep->lnkcnt = 0; /* not linked anywhere */ |
nodep->refcnt = 1; |
static int fat_destroy(void *node) |
nodep->idx = idxp; |
idxp->nodep = nodep; |
futex_up(&idxp->lock); |
return nodep; |
} |
static int fat_destroy_node(void *node) |
{ |
return ENOTSUP; /* not supported at the moment */ |
} |
424,8 → 463,8 |
.match = fat_match, |
.node_get = fat_node_get, |
.node_put = fat_node_put, |
.create = fat_create, |
.destroy = fat_destroy, |
.create = fat_create_node, |
.destroy = fat_destroy_node, |
.link = fat_link, |
.unlink = fat_unlink, |
.index_get = fat_index_get, |