Changes in / [383ddd6:6c01702] in mainline


Ignore:
Files:
81 added
18 deleted
65 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r383ddd6 r6c01702  
    2626# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727#
    28 
    29 -include ../Makefile.config
    3028
    3129TMP = distroot
  • boot/arch/ia64/loader/Makefile

    r383ddd6 r6c01702  
    2929
    3030include Makefile.common
    31 include ../../../../Makefile.config
    3231
    3332.PHONY: all clean
  • boot/arch/ia64/loader/Makefile.common

    r383ddd6 r6c01702  
    3131#
    3232
    33 include ../../../../Makefile.config
    3433include ../../../Makefile.common
    3534
     
    4544KERNELDIR = ../../../../kernel
    4645USPACEDIR = ../../../../uspace
    47 
    48 ifeq ($(MACHINE),i460GX)
    49         RD_SRVS += \
    50                 $(USPACEDIR)/srv/hw/char/i8042/i8042 \
    51                 $(USPACEDIR)/srv/hid/c_mouse/c_mouse
    52 endif
  • boot/arch/ia64/loader/gefi/HelenOS/Makefile

    r383ddd6 r6c01702  
    3333FORMAT          = efi-app-$(ARCH)
    3434
    35 all:    hello.efi
     35all:    gefi hello.efi
    3636
    3737clean:
     
    4646#When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot
    4747#hello.so: hello.o image.o division.o
    48 hello.so: hello.o image.bin division.o gefi
     48hello.so: hello.o image.bin division.o
    4949#       $(LD) $(LDFLAGS) -Map hello.map hello.o division.o image.o -o hello.so $(LOADLIBES) #link image inside hello
    5050        $(LD) $(LDFLAGS) -Map hello.map hello.o division.o -o hello.so $(LOADLIBES) #dont link image inside hello
  • kernel/arch/arm32/Makefile.inc

    r383ddd6 r6c01702  
    3838ATSIGN = %
    3939
    40 GCC_CFLAGS += -fno-zero-initialized-in-bss -mapcs-frame
     40GCC_CFLAGS += -fno-zero-initialized-in-bss
    4141
    4242BITS = 32
  • kernel/arch/arm32/include/context.h

    r383ddd6 r6c01702  
    4343#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    4444
    45 #define context_set(c, _pc, stack, size) \
    46         do { \
    47                 (c)->pc = (uintptr_t) (_pc); \
    48                 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
    49                 (c)->fp = 0; \
    50         } while (0)
    51 
    5245#ifndef __ASM__
    5346
     
    6962        uint32_t r9;
    7063        uint32_t r10;
    71         uint32_t fp;    /* r11 */
     64        uint32_t r11;
    7265       
    7366        ipl_t ipl;
  • kernel/arch/arm32/include/exception.h

    r383ddd6 r6c01702  
    102102        uint32_t r9;
    103103        uint32_t r10;
    104         uint32_t fp;
     104        uint32_t r11;
    105105        uint32_t r12;
    106106
     
    135135static inline unative_t istate_get_fp(istate_t *istate)
    136136{
    137         return istate->fp;
     137        return istate->r11;
    138138}
    139139
  • kernel/arch/arm32/src/debug/stacktrace.c

    r383ddd6 r6c01702  
    3838#include <typedefs.h>
    3939
    40 #define FRAME_OFFSET_FP_PREV    -3
    41 #define FRAME_OFFSET_RA         -1
    42 
    4340bool kernel_frame_pointer_validate(uintptr_t fp)
    4441{
    45         return fp != 0;
     42        return false;
    4643}
    4744
    4845bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    4946{
    50         uint32_t *stack = (void *) fp;
    51 
    52         *prev = stack[FRAME_OFFSET_FP_PREV];
    53         return true;
     47        return false;
    5448}
    5549
    5650bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra)
    5751{
    58         uint32_t *stack = (void *) fp;
    59 
    60         *ra = stack[FRAME_OFFSET_RA];
    61         return true;
     52        return false;
    6253}
    6354
    6455bool uspace_frame_pointer_validate(uintptr_t fp)
    6556{
    66         return fp != 0;
     57        return false;
    6758}
    6859
    6960bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    7061{
    71         return !copy_from_uspace((void *) prev,
    72             (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev));
     62        return false;
    7363}
    7464
    7565bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra)
    7666{
    77         return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA,
    78             sizeof(*ra));
     67        return false;
    7968}
    8069
  • kernel/arch/arm32/src/debug/stacktrace_asm.S

    r383ddd6 r6c01702  
    3333
    3434frame_pointer_get:
    35         mov r0, fp
    3635        mov pc, lr
    3736
    3837program_counter_get:
    39         mov r0, lr
    4038        mov pc, lr
  • kernel/arch/arm32/src/exc_handler.S

    r383ddd6 r6c01702  
    123123        stmfd r13!, {r2}
    1241242:
    125         # Stop stack traces here
    126         mov fp, #0
    127125.endm
    128126
  • kernel/arch/arm32/src/exception.c

    r383ddd6 r6c01702  
    4242#include <print.h>
    4343#include <syscall/syscall.h>
    44 #include <stacktrace.h>
    4544
    4645#ifdef MACHINE_testarm
     
    184183        printf(" r4: %x    r5: %x    r6: %x    r7: %x\n",
    185184            istate->r4, istate->r5, istate->r6, istate->r7);
    186         printf(" r8: %x    r8: %x   r10: %x    fp: %x\n",
    187             istate->r8, istate->r9, istate->r10, istate->fp);
     185        printf(" r8: %x    r8: %x   r10: %x   r11: %x\n",
     186            istate->r8, istate->r9, istate->r10, istate->r11);
    188187        printf(" r12: %x    sp: %x    lr: %x  spsr: %x\n",
    189188            istate->r12, istate->sp, istate->lr, istate->spsr);
    190189       
    191190        printf(" pc: %x\n", istate->pc);
    192 
    193         stack_trace_istate(istate);
    194191}
    195192
  • kernel/arch/arm32/src/mm/page_fault.c

    r383ddd6 r6c01702  
    181181
    182182        if (ret == AS_PF_FAULT) {
    183                 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr);
    184183                print_istate(istate);
    185184                printf("page fault - pc: %x, va: %x, status: %x(%x), "
     
    187186                    access);
    188187               
     188                fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr);
    189189                panic("Page fault.");
    190190        }
  • kernel/arch/arm32/src/start.S

    r383ddd6 r6c01702  
    6969        bl arch_pre_main
    7070       
    71         #
    72         # Create the first stack frame.
    73         #
    74         mov fp, #0
    75         mov ip, sp
    76         push {fp, ip, lr, pc}
    77         sub fp, ip, #4
    78 
    7971        bl main_bsp
    8072
  • kernel/arch/ia64/include/mm/asid.h

    r383ddd6 r6c01702  
    5050 * but those extra bits are not used by the kernel.
    5151 */
    52 #define RIDS_PER_ASID           8
     52#define RIDS_PER_ASID           7
    5353
    5454#define RID_MAX                 262143          /* 2^18 - 1 */
    55 #define RID_KERNEL7             7
     55#define RID_KERNEL              0
     56#define RID_INVALID             1
    5657
    57 #define ASID2RID(asid, vrn) \
    58         ((asid) * RIDS_PER_ASID + (vrn))
     58#define ASID2RID(asid, vrn)     (((asid)>RIDS_PER_ASID)?(((asid)*RIDS_PER_ASID)+(vrn)):(asid))
     59#define RID2ASID(rid)           ((rid)/RIDS_PER_ASID)
    5960
    60 #define RID2ASID(rid) \
    61         ((rid) / RIDS_PER_ASID)
    62 
    63 #define ASID_MAX_ARCH           (RID_MAX / RIDS_PER_ASID)
     61#define ASID_MAX_ARCH           (RID_MAX/RIDS_PER_ASID)
    6462
    6563#endif
  • kernel/arch/ia64/src/ia64.c

    r383ddd6 r6c01702  
    203203        }
    204204       
    205         sysinfo_set_item_val("i8042", NULL, true);
    206         sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD);
    207         sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE);
    208         sysinfo_set_item_val("i8042.address.physical", NULL,
     205        sysinfo_set_item_val("kbd", NULL, true);
     206        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
     207        sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
     208        sysinfo_set_item_val("kbd.address.physical", NULL,
    209209            (uintptr_t) I8042_BASE);
    210         sysinfo_set_item_val("i8042.address.kernel", NULL,
     210        sysinfo_set_item_val("kbd.address.kernel", NULL,
    211211            (uintptr_t) I8042_BASE);
    212212#endif
  • kernel/arch/ia64/src/mm/page.c

    r383ddd6 r6c01702  
    7171
    7272        /*
    73          * Set up kernel region registers.
    74          * VRN_KERNEL has already been set in start.S.
    75          * For paranoia reasons, we set it again.
     73         * First set up kernel region register.
     74         * This is redundant (see start.S) but we keep it here just for sure.
     75         */
     76        rr.word = rr_read(VRN_KERNEL);
     77        rr.map.ve = 0;                  /* disable VHPT walker */
     78        rr.map.ps = PAGE_WIDTH;
     79        rr.map.rid = ASID2RID(ASID_KERNEL, VRN_KERNEL);
     80        rr_write(VRN_KERNEL, rr.word);
     81        srlz_i();
     82        srlz_d();
     83
     84        /*
     85         * And setup the rest of region register.
    7686         */
    7787        for(i = 0; i < REGION_REGISTERS; i++) {
     88                /* skip kernel rr */
     89                if (i == VRN_KERNEL)
     90                        continue;
     91       
    7892                rr.word = rr_read(i);
    7993                rr.map.ve = 0;          /* disable VHPT walker */
    80                 rr.map.rid = ASID2RID(ASID_KERNEL, i);
     94                rr.map.rid = RID_KERNEL;
    8195                rr.map.ps = PAGE_WIDTH;
    8296                rr_write(i, rr.word);
  • kernel/arch/ia64/src/start.S

    r383ddd6 r6c01702  
    7474        movl r10 = (RR_MASK)
    7575        and r9 = r10, r9
    76         movl r10 = (((RID_KERNEL7) << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))
     76        movl r10 = ((RID_KERNEL << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))
    7777        or r9 = r10, r9
    7878       
  • kernel/generic/src/console/kconsole.c

    r383ddd6 r6c01702  
    543543                if (str_lcmp(hlp->name, cmdline + start,
    544544                    max(str_length(hlp->name),
    545                     str_nlength(cmdline + start, (size_t) (end - start)))) == 0) {
     545                    str_nlength(cmdline + start, (size_t) (end - start) - 1))) == 0) {
    546546                        cmd = hlp;
    547547                        break;
  • uspace/Makefile

    r383ddd6 r6c01702  
    8181        lib/libblock \
    8282        lib/softint \
    83         lib/softfloat \
    84 
    85 ifeq ($(UARCH),amd64)
    86         LIBS += lib/libpci
    87 endif
    88 
    89 ifeq ($(UARCH),ia32)
    90         LIBS += lib/libpci
    91 endif
    92 
     83        lib/softfloat
    9384
    9485LIBC_BUILD = $(addsuffix .build,$(LIBC))
  • uspace/app/bdsh/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I. -Icmds/ -Icmds/builtins -Icmds/modules
     30include Makefile.common
    3331
    34 OUTPUT = bdsh
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         cmds/modules/help/help.c \
    38         cmds/modules/mkdir/mkdir.c \
    39         cmds/modules/mkfile/mkfile.c \
    40         cmds/modules/rm/rm.c \
    41         cmds/modules/bdd/bdd.c \
    42         cmds/modules/cat/cat.c \
    43         cmds/modules/touch/touch.c \
    44         cmds/modules/ls/ls.c \
    45         cmds/modules/pwd/pwd.c \
    46         cmds/modules/sleep/sleep.c \
    47         cmds/modules/cp/cp.c \
    48         cmds/modules/mv/mv.c \
    49         cmds/modules/mount/mount.c \
    50         cmds/modules/kcon/kcon.c \
    51         cmds/builtins/exit/exit.c \
    52         cmds/builtins/cd/cd.c \
    53         cmds/mod_cmds.c \
    54         cmds/builtin_cmds.c \
    55         errors.c \
    56         input.c \
    57         util.c \
    58         exec.c \
    59         scli.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    6037
    61 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/edit/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = edit
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         edit.c \
    37         sheet.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3837
    39 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/getterm/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 include ../../../version
    31 DEFS += -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
     30include Makefile.common
    3231
    33 USPACE_PREFIX = ../..
    34 LIBS = $(LIBC_PREFIX)/libc.a
     32.PHONY: all clean
    3533
    36 OUTPUT = getterm
     34all: $(LIBC_PREFIX)/../../../version $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 SOURCES = \
    39         getterm.c \
    40         version.c
    41 
    42 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/init/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = init
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         init.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/klog/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = klog
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         klog.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/mkfat/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = mkfat
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         mkfat.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3837
    39 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/redir/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = redir
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         redir.c
     34all: $(LIBC_PREFIX)/../../../version $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/tester/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = tester
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         tester.c \
    37         thread/thread1.c \
    38         print/print1.c \
    39         print/print2.c \
    40         print/print3.c \
    41         print/print4.c \
    42         console/console1.c \
    43         stdio/stdio1.c \
    44         stdio/stdio2.c \
    45         fault/fault1.c \
    46         fault/fault2.c \
    47         fault/fault3.c \
    48         vfs/vfs1.c \
    49         ipc/ping_pong.c \
    50         ipc/register.c \
    51         ipc/connect.c \
    52         loop/loop1.c \
    53         mm/malloc1.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    5437
    55 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/tetris/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = tetris
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         shapes.c \
    37         scores.c \
    38         input.c \
    39         tetris.c \
    40         screen.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4137
    42 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/app/trace/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = trace
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         trace.c \
    37         syscalls.c \
    38         ipcp.c \
    39         ipc_desc.c \
    40         proto.c \
    41         errors.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4237
    43 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/lib/libblock/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = libblock.a
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         libblock.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBBLOCK)
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/lib/libc/Makefile

    r383ddd6 r6c01702  
    11#
    22# Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
    43# All rights reserved.
    54#
     
    2827#
    2928
    30 -include ../../../Makefile.config
     29include Makefile.common
    3130
    32 USPACE_PREFIX = $(shell pwd)/../..
    33 #LIBS = $(LIBC_PREFIX)/libc.a
    34 LIBS =
     31.PHONY: all clean
    3532
    36 LINK = arch/$(UARCH)/_link.ld
     33all: ../../../Makefile.config ../../../config.h ../../../config.defs
     34        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     35        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3736
    38 PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
    39 EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
    40 EXTRA_OUTPUT = $(LINK)
    41 
    42 INCLUDE_KERNEL = include/kernel
    43 INCLUDE_ARCH = include/arch
    44 INCLUDE_LIBARCH = include/libarch
    45 
    46 OUTPUT = libc.a
    47 
    48 GENERIC_SOURCES = \
    49         generic/libc.c \
    50         generic/ddi.c \
    51         generic/as.c \
    52         generic/cap.c \
    53         generic/clipboard.c \
    54         generic/devmap.c \
    55         generic/event.c \
    56         generic/errno.c \
    57         generic/mem.c \
    58         generic/string.c \
    59         generic/fibril.c \
    60         generic/fibril_synch.c \
    61         generic/pcb.c \
    62         generic/smc.c \
    63         generic/thread.c \
    64         generic/tls.c \
    65         generic/task.c \
    66         generic/futex.c \
    67         generic/io/asprintf.c \
    68         generic/io/io.c \
    69         generic/io/printf.c \
    70         generic/io/klog.c \
    71         generic/io/snprintf.c \
    72         generic/io/vprintf.c \
    73         generic/io/vsnprintf.c \
    74         generic/io/printf_core.c \
    75         generic/io/console.c \
    76         generic/malloc.c \
    77         generic/sysinfo.c \
    78         generic/ipc.c \
    79         generic/async.c \
    80         generic/loader.c \
    81         generic/getopt.c \
    82         generic/adt/list.o \
    83         generic/adt/hash_table.o \
    84         generic/time.c \
    85         generic/err.c \
    86         generic/stdlib.c \
    87         generic/mman.c \
    88         generic/udebug.c \
    89         generic/vfs/vfs.c \
    90         generic/vfs/canonify.c \
    91         generic/stacktrace.c
    92 
    93 ARCH_SOURCES = \
    94         arch/$(UARCH)/src/entry.s \
    95         arch/$(UARCH)/src/thread_entry.s
    96 
    97 SOURCES = \
    98         $(GENERIC_SOURCES) \
    99         $(ARCH_SOURCES)
    100 
    101 include ../Makefile.common
    102 
    103 $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch
    104         ln -sfn kernel/arch $@
    105 
    106 $(INCLUDE_LIBARCH): arch/$(UARCH)/include
    107         ln -sfn ../$< $@
    108 
    109 $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL)
    110 
    111 $(INCLUDE_KERNEL): ../../../kernel/generic/include/
    112         ln -sfn ../$< $@
    113 
    114 $(LINK): $(LINK).in
    115         $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
     37clean:
     38        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LIBC) arch/*/_link.ld
     39        find generic/ arch/*/ -name '*.o' -follow -exec rm \{\} \;
  • uspace/lib/libc/Makefile.toolchain

    r383ddd6 r6c01702  
    5959#
    6060
    61 -include $(LIBC_PREFIX)/../../../Makefile.config
    62 -include $(LIBC_PREFIX)/../../../config.defs
    63 -include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
     61include $(LIBC_PREFIX)/../../../Makefile.config
     62include $(LIBC_PREFIX)/../../../config.defs
     63include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
    6464
    6565## Simple detection of the host system
  • uspace/lib/libc/arch/mips32eb/Makefile.inc

    r383ddd6 r6c01702  
    3535ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
    3636        arch/$(UARCH)/src/fibril.S \
    37         arch/$(UARCH)/src/tls.c \
    38         arch/$(UARCH)/src/stacktrace.S
     37        arch/$(UARCH)/src/tls.c
    3938
    4039GCC_CFLAGS += -mips3
  • uspace/lib/libfs/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = libfs.a
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         libfs.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBFS)
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/lib/softfloat/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS += -Iinclude -Iarch/$(UARCH)/include/
     30include Makefile.common
    3331
    34 OUTPUT = libsoftfloat.a
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         generic/add.c \
    38         generic/common.c \
    39         generic/comparison.c \
    40         generic/conversion.c \
    41         generic/div.c \
    42         generic/mul.c \
    43         generic/other.c \
    44         generic/softfloat.c \
    45         generic/sub.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4637
    47 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBSOFTFLOAT)
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/lib/softint/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -Iinclude
     30include Makefile.common
    3331
    34 OUTPUT = libsoftint.a
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         generic/division.c\
    38         generic/multiplication.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBC_PREFIX)/libc.a
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3937
    40 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(LIBSOFTINT)
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/bd/ata_bd/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = ata_bd
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         ata_bd.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/bd/file_bd/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = file_bd
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         file_bd.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/bd/gxe_bd/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = gxe_bd
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         gxe_bd.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/bd/part/mbr_part/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = mbr_part
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         mbr_part.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3837
    39 include ../../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/bd/rd/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = rd
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         rd.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/clip/Makefile

    r383ddd6 r6c01702  
    11#
    2 # Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
     2# Copyright (c) 2009 Martin Decky
    43# All rights reserved.
    54#
     
    2827#
    2928
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     29include Makefile.common
    3230
    33 OUTPUT = clip
     31.PHONY: all clean
    3432
    35 SOURCES = \
    36         clip.c
     33all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     34        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     35        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3736
    38 include ../Makefile.common
     37clean:
     38        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     39        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/devmap/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = devmap
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         devmap.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/fs/devfs/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS += -I$(LIBFS_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = devfs
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         devfs.c \
    38         devfs_ops.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3937
    40 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/fs/fat/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = fat
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         fat.c \
    38         fat_ops.c \
    39         fat_idx.c \
    40         fat_dentry.c \
    41         fat_fat.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4237
    43 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/fs/fat/fat_fat.c

    r383ddd6 r6c01702  
    247247 */
    248248int
    249 fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno,
    250     fat_cluster_t clst, fat_cluster_t *value)
     249fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t clst,
     250    fat_cluster_t *value)
    251251{
    252252        block_t *b;
    253253        uint16_t bps;
    254254        uint16_t rscnt;
    255         uint16_t sf;
    256255        fat_cluster_t *cp;
    257256        int rc;
     
    259258        bps = uint16_t_le2host(bs->bps);
    260259        rscnt = uint16_t_le2host(bs->rscnt);
    261         sf = uint16_t_le2host(bs->sec_per_fat);
    262 
    263         rc = block_get(&b, dev_handle, rscnt + sf * fatno +
     260
     261        rc = block_get(&b, dev_handle, rscnt +
    264262            (clst * sizeof(fat_cluster_t)) / bps, BLOCK_FLAGS_NONE);
    265263        if (rc != EOK)
     
    400398                         * from the size of the file allocation table.
    401399                         */
    402                         if ((cl >= 2) && ((cl - 2) * bs->spc + ssa >= ts)) {
     400                        if ((cl - 2) * bs->spc + ssa >= ts) {
    403401                                rc = block_put(blk);
    404402                                if (rc != EOK)
     
    482480        while (firstc < FAT_CLST_LAST1) {
    483481                assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD);
    484                 rc = fat_get_cluster(bs, dev_handle, FAT1, firstc, &nextc);
     482                rc = fat_get_cluster(bs, dev_handle, firstc, &nextc);
    485483                if (rc != EOK)
    486484                        return rc;
     
    562560                unsigned fatno;
    563561
    564                 rc = fat_get_cluster(bs, dev_handle, FAT1, lastc, &nextc);
     562                rc = fat_get_cluster(bs, dev_handle, lastc, &nextc);
    565563                if (rc != EOK)
    566564                        return rc;
  • uspace/srv/fs/fat/fat_fat.h

    r383ddd6 r6c01702  
    8080extern int fat_alloc_shadow_clusters(struct fat_bs *, dev_handle_t,
    8181    fat_cluster_t *, unsigned);
    82 extern int fat_get_cluster(struct fat_bs *, dev_handle_t, unsigned,
    83     fat_cluster_t, fat_cluster_t *);
     82extern int fat_get_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t,
     83    fat_cluster_t *);
    8484extern int fat_set_cluster(struct fat_bs *, dev_handle_t, unsigned,
    8585    fat_cluster_t, fat_cluster_t);
  • uspace/srv/fs/fat/fat_ops.c

    r383ddd6 r6c01702  
    290290
    291291        *nodepp = nodep;
    292         return EOK;
    293 }
    294 
    295 /** Perform basic sanity checks on the file system.
    296  *
    297  * Verify if values of boot sector fields are sane. Also verify media
    298  * descriptor. This is used to rule out cases when a device obviously
    299  * does not contain a fat file system.
    300  */
    301 static int fat_sanity_check(fat_bs_t *bs, dev_handle_t dev_handle)
    302 {
    303         fat_cluster_t e0, e1;
    304         unsigned fat_no;
    305         int rc;
    306 
    307         /* Check number of FATs. */
    308         if (bs->fatcnt == 0)
    309                 return ENOTSUP;
    310 
    311         /* Check total number of sectors. */
    312 
    313         if (bs->totsec16 == 0 && bs->totsec32 == 0)
    314                 return ENOTSUP;
    315 
    316         if (bs->totsec16 != 0 && bs->totsec32 != 0 &&
    317             bs->totsec16 != bs->totsec32)
    318                 return ENOTSUP;
    319 
    320         /* Check media descriptor. Must be between 0xf0 and 0xff. */
    321         if ((bs->mdesc & 0xf0) != 0xf0)
    322                 return ENOTSUP;
    323 
    324         /* Check number of sectors per FAT. */
    325         if (bs->sec_per_fat == 0)
    326                 return ENOTSUP;
    327 
    328         /*
    329          * Check that the root directory entries take up whole blocks.
    330          * This check is rather strict, but it allows us to treat the root
    331          * directory and non-root directories uniformly in some places.
    332          * It can be removed provided that functions such as fat_read() are
    333          * sanitized to support file systems with this property.
    334          */
    335         if ((uint16_t_le2host(bs->root_ent_max) * sizeof(fat_dentry_t)) %
    336             uint16_t_le2host(bs->bps) != 0)
    337                 return ENOTSUP;
    338 
    339         /* Check signature of each FAT. */
    340 
    341         for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) {
    342                 rc = fat_get_cluster(bs, dev_handle, fat_no, 0, &e0);
    343                 if (rc != EOK)
    344                         return EIO;
    345 
    346                 rc = fat_get_cluster(bs, dev_handle, fat_no, 1, &e1);
    347                 if (rc != EOK)
    348                         return EIO;
    349 
    350                 /* Check that first byte of FAT contains the media descriptor. */
    351                 if ((e0 & 0xff) != bs->mdesc)
    352                         return ENOTSUP;
    353 
    354                 /*
    355                  * Check that remaining bits of the first two entries are
    356                  * set to one.
    357                  */
    358                 if ((e0 >> 8) != 0xff || e1 != 0xffff)
    359                         return ENOTSUP;
    360         }
    361 
    362292        return EOK;
    363293}
     
    1051981        }
    1052982
    1053         /* Do some simple sanity checks on the file system. */
    1054         rc = fat_sanity_check(bs, dev_handle);
    1055         if (rc != EOK) {
    1056                 block_fini(dev_handle);
    1057                 ipc_answer_0(rid, rc);
    1058                 return;
    1059         }
    1060 
    1061983        rc = fat_idx_init_by_dev_handle(dev_handle);
    1062984        if (rc != EOK) {
  • uspace/srv/fs/tmpfs/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = tmpfs
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         tmpfs.c \
    38         tmpfs_ops.c \
    39         tmpfs_dump.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4037
    41 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/hid/c_mouse/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -Iinclude
     30include Makefile.common
    3331
    34 OUTPUT = c_mouse
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         proto/ps2.c \
    38         c_mouse.c \
    39         chardev.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4037
    41 include ../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/hw/bus/pci/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBPCI_PREFIX)/libpci.a $(LIBC_PREFIX)/libc.a
    32 EXTRA_CFLAGS = -I$(LIBPCI_PREFIX)
     30include Makefile.common
    3331
    34 OUTPUT = pci
     32.PHONY: all clean
    3533
    36 SOURCES = \
    37         pci.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3837
    39 include ../../../Makefile.common
     38$(LIBPCI):
     39        $(MAKE) -C libpci PRECHECK=$(PRECHECK)
     40
     41clean:
     42        $(MAKE) -C libpci clean
     43        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     44        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/hw/bus/pci/pci.c

    r383ddd6 r6c01702  
    2121#include <errno.h>
    2222
    23 #include <pci.h>
     23#include "libpci/pci.h"
    2424
    2525#define PCI_CONF1       0xcf8
  • uspace/srv/hw/char/i8042/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = i8042
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         i8042.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/hw/cir/fhc/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = fhc
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         fhc.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/hw/cir/obio/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = obio
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         obio.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    3737
    38 include ../../../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/loader/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 -include ../../../Makefile.config
    31 -include arch/$(UARCH)/Makefile.inc
     30include Makefile.common
    3231
    33 USPACE_PREFIX = ../..
    34 LIBS = $(LIBC_PREFIX)/libc.a
    35 EXTRA_CFLAGS += -Iinclude
    36 LINK_SCRIPT = arch/$(UARCH)/_link.ld
     32.PHONY: all clean
    3733
    38 OUTPUT = loader
    39 EXTRA_OUTPUT = $(LINK_SCRIPT)
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4037
    41 GENERIC_SOURCES = \
    42         main.c \
    43         elf_load.c \
    44         interp.s
    45 
    46 SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES)
    47 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    48 
    49 include ../Makefile.common
    50 
    51 $(LINK_SCRIPT): $(LINK_SCRIPT).in
    52         $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm arch/*/_link.ld
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/loader/arch/amd64/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__64_BITS__
     29CFLAGS += -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/amd64.s
  • uspace/srv/loader/arch/arm32/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__32_BITS__
     29CFLAGS += -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/arm32.s
  • uspace/srv/loader/arch/ia32/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__32_BITS__
     29CFLAGS += -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ia32.s
  • uspace/srv/loader/arch/ia64/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__64_BITS__
     29CFLAGS += -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ia64.s
    3131AFLAGS += -xexplicit
  • uspace/srv/loader/arch/mips32/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__32_BITS__
     29CFLAGS += -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/mips32.s
  • uspace/srv/loader/arch/ppc32/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__32_BITS__
     29CFLAGS += -D__32_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/ppc32.s
  • uspace/srv/loader/arch/sparc64/Makefile.inc

    r383ddd6 r6c01702  
    2727#
    2828
    29 EXTRA_CFLAGS = -D__64_BITS__
     29CFLAGS += -D__64_BITS__
    3030ARCH_SOURCES := arch/$(UARCH)/sparc64.s
  • uspace/srv/ns/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = ns
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         ns.c \
    37         service.c \
    38         clonable.c \
    39         task.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4037
    41 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
  • uspace/srv/vfs/Makefile

    r383ddd6 r6c01702  
    2828#
    2929
    30 USPACE_PREFIX = ../..
    31 LIBS = $(LIBC_PREFIX)/libc.a
     30include Makefile.common
    3231
    33 OUTPUT = vfs
     32.PHONY: all clean
    3433
    35 SOURCES = \
    36         vfs.c \
    37         vfs_node.c \
    38         vfs_file.c \
    39         vfs_ops.c \
    40         vfs_lookup.c \
    41         vfs_register.c
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
     35        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     36        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    4237
    43 include ../Makefile.common
     38clean:
     39        rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm
     40        find . -name '*.o' -follow -exec rm \{\} \;
Note: See TracChangeset for help on using the changeset viewer.