Changes in / [9a1d8ab:dba4a23] in mainline
- Files:
-
- 13 added
- 4 deleted
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r9a1d8ab rdba4a23 441 441 ! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_UART (y/n) 442 442 443 % Support for Samsung S3C24XX on-chip interrupt controller444 ! [PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_IRQC (y)445 446 443 % Support for Z8530 controller 447 444 ! [(CONFIG_HID_IN=generic|CONFIG_HID_IN=keyboard)&PLATFORM=sparc64&MACHINE=generic] CONFIG_Z8530 (y/n) … … 472 469 473 470 % Serial line input module 474 ! [CONFIG_DSRLNIN=y|(PLATFORM= arm32&MACHINE=gta02)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&MACHINE=serengeti&CONFIG_SGCN_KBD=y)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)471 ! [CONFIG_DSRLNIN=y|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&MACHINE=serengeti&CONFIG_SGCN_KBD=y)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y) 475 472 476 473 % EGA support … … 546 543 ! CONFIG_BAREBONE (n/y) 547 544 548 % Line debugging information549 ! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y) -
boot/Makefile
r9a1d8ab rdba4a23 48 48 endif 49 49 ifeq ($(RDFMT),fat) 50 $(MKFAT) 1048576$(DIST_PATH) $@50 $(MKFAT) $(DIST_PATH) $@ 51 51 endif 52 52 -
boot/Makefile.build
r9a1d8ab rdba4a23 61 61 GCC_CFLAGS += -Werror 62 62 ICC_CFLAGS += -Werror 63 endif64 65 ifeq ($(CONFIG_LINE_DEBUG),y)66 GCC_CFLAGS += -g67 ICC_CFLAGS += -g68 SUNCC_CFLAGS += -g69 CLANG_CFLAGS += -g70 63 endif 71 64 -
boot/arch/arm32/Makefile.inc
r9a1d8ab rdba4a23 41 41 PAGE_SIZE = 4096 42 42 43 RD_SRVS_ESSENTIAL += \ 44 $(USPACE_PATH)/srv/hw/char/s3c24xx_uart/s3c24ser 43 RD_SRVS_ESSENTIAL += 45 44 46 45 RD_SRVS_NON_ESSENTIAL += \ -
boot/arch/mips32/src/Makefile
r9a1d8ab rdba4a23 32 32 .PHONY: all clean 33 33 34 all: ../../../../version ../../../../Makefile.co mmon ../../../../Makefile.config ../../../../config.h34 all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(USPACEDIR)/dist/srv/*40 rm -f $(USPACEDIR)/dist/app/*41 rm -f $(USPACEDIR)/dist/cfg/net/*42 43 39 for file in $(RD_SRVS) ; do \ 44 40 rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \ … … 47 43 rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \ 48 44 done 49 for file in $(NET_CFG) ; do \50 rm -f $(USPACEDIR)/dist/cfg/net/`basename $$file` ; \51 done52 45 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(RAW) $(COMPS).h $(COMPS).c $(LINK) $(INITRD).img $(INITRD).fs 53 46 find . -name '*.o' -follow -exec rm \{\} \; -
boot/arch/mips32/src/Makefile.build
r9a1d8ab rdba4a23 32 32 33 33 include ../../../../version 34 include ../../../../Makefile.common35 34 include ../../../../Makefile.config 35 include ../../../../config.defs 36 36 include Makefile.common 37 37 include Makefile.toolchain … … 77 77 78 78 $(DEPEND): 79 rm -f $(USPACEDIR)/dist/srv/*80 rm -f $(USPACEDIR)/dist/app/*81 rm -f $(USPACEDIR)/dist/cfg/net/*82 83 79 for file in $(RD_SRVS) ; do \ 84 80 cp $$file $(USPACEDIR)/dist/srv/ ; \ … … 86 82 for file in $(RD_APPS) ; do \ 87 83 cp $$file $(USPACEDIR)/dist/app/ ; \ 88 done89 for file in $(NET_CFG) ; do \90 cp $$file $(USPACEDIR)/dist/cfg/net/ ; \91 84 done 92 85 ifeq ($(RDFMT),tmpfs) -
boot/arch/mips32/src/Makefile.toolchain
r9a1d8ab rdba4a23 27 27 # 28 28 29 ## Toolchain configuration 30 # 31 32 ifndef CROSS_PREFIX 33 CROSS_PREFIX = /usr/local 34 endif 35 29 36 BFD_ARCH = mips 37 TARGET = mipsel-linux-gnu 38 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin 30 39 31 40 JOBFILE = ../../../../tools/jobfile.py … … 39 48 BFD_NAME = elf32-tradbigmips 40 49 BFD = ecoff-bigmips 50 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin 51 TARGET = mips-linux-gnu 41 52 endif 42 53 … … 44 55 BFD_NAME = elf32-tradlittlemips 45 56 BFD = binary 57 endif 58 59 ifeq ($(COMPILER),gcc_native) 60 CC = gcc 61 AS = as 62 LD = ld 63 OBJCOPY = objcopy 64 OBJDUMP = objdump 65 endif 66 67 ifeq ($(COMPILER),gcc_cross) 68 CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc 69 AS = $(TOOLCHAIN_DIR)/$(TARGET)-as 70 LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld 71 OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy 72 OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump 46 73 endif 47 74 -
contrib/conf/ia32-qe.sh
r9a1d8ab rdba4a23 5 5 # Create a disk image if it does not exist 6 6 if [ ! -f "$DISK_IMG" ]; then 7 tools/mkfat.py 1048576uspace/dist/data "$DISK_IMG"7 tools/mkfat.py uspace/dist/data "$DISK_IMG" 8 8 fi 9 9 -
contrib/conf/mips32-gx.sh
r9a1d8ab rdba4a23 5 5 # Create a disk image if it does not exist 6 6 if [ ! -f "$DISK_IMG" ]; then 7 tools/mkfat.py 1048576uspace/dist/data "$DISK_IMG"7 tools/mkfat.py uspace/dist/data "$DISK_IMG" 8 8 fi 9 9 -
kernel/Makefile
r9a1d8ab rdba4a23 120 120 ifeq ($(CONFIG_LTO),y) 121 121 GCC_CFLAGS += -flto 122 endif123 124 ifeq ($(CONFIG_LINE_DEBUG),y)125 GCC_CFLAGS += -g126 ICC_CFLAGS += -g127 SUNCC_CFLAGS += -g128 CLANG_CFLAGS += -g129 122 endif 130 123 … … 408 401 409 402 $(DISASM): $(RAW) 410 ifeq ($(CONFIG_LINE_DEBUG),y)411 $(OBJDUMP) -d -S $< > $@412 else413 403 $(OBJDUMP) -d $< > $@ 414 endif415 404 416 405 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) -
kernel/arch/amd64/_link.ld.in
r9a1d8ab rdba4a23 53 53 } 54 54 55 #ifdef CONFIG_LINE_DEBUG56 .comment 0 : { *(.comment); }57 .debug_abbrev 0 : { *(.debug_abbrev); }58 .debug_aranges 0 : { *(.debug_aranges); }59 .debug_info 0 : { *(.debug_info); }60 .debug_line 0 : { *(.debug_line); }61 .debug_loc 0 : { *(.debug_loc); }62 .debug_pubnames 0 : { *(.debug_pubnames); }63 .debug_pubtypes 0 : { *(.debug_pubtypes); }64 .debug_ranges 0 : { *(.debug_ranges); }65 .debug_str 0 : { *(.debug_str); }66 #endif67 68 55 /DISCARD/ : { 69 56 *(*); -
kernel/arch/arm32/include/mach/integratorcp/integratorcp.h
r9a1d8ab rdba4a23 105 105 extern void icp_get_memory_extents(uintptr_t *, uintptr_t *); 106 106 extern void icp_frame_init(void); 107 extern size_t icp_get_irq_count(void);108 107 109 108 extern struct arm_machine_ops icp_machine_ops; -
kernel/arch/arm32/include/mach/testarm/testarm.h
r9a1d8ab rdba4a23 73 73 extern void gxemul_get_memory_extents(uintptr_t *, uintptr_t *); 74 74 extern void gxemul_frame_init(void); 75 extern size_t gxemul_get_irq_count(void);76 75 77 76 extern struct arm_machine_ops gxemul_machine_ops; -
kernel/arch/arm32/include/machine_func.h
r9a1d8ab rdba4a23 55 55 void (*machine_output_init)(void); 56 56 void (*machine_input_init)(void); 57 size_t (*machine_get_irq_count)(void);58 57 }; 59 58 -
kernel/arch/arm32/src/mach/gta02/gta02.c
r9a1d8ab rdba4a23 43 43 #include <genarch/drivers/s3c24xx_irqc/s3c24xx_irqc.h> 44 44 #include <genarch/drivers/s3c24xx_timer/s3c24xx_timer.h> 45 #include <genarch/srln/srln.h>46 #include <sysinfo/sysinfo.h>47 45 #include <interrupt.h> 48 46 #include <ddi/ddi.h> … … 70 68 static void gta02_output_init(void); 71 69 static void gta02_input_init(void); 72 static size_t gta02_get_irq_count(void);73 70 74 71 static void gta02_timer_irq_init(void); … … 77 74 static void gta02_timer_irq_handler(irq_t *irq); 78 75 79 static outdev_t *gta02_scons_dev;80 static s3c24xx_irqc_t gta02_irqc;76 static void *gta02_scons_out; 77 static s3c24xx_irqc_t *gta02_irqc; 81 78 static s3c24xx_timer_t *gta02_timer; 82 79 … … 91 88 gta02_frame_init, 92 89 gta02_output_init, 93 gta02_input_init, 94 gta02_get_irq_count 90 gta02_input_init 95 91 }; 96 92 97 93 static void gta02_init(void) 98 94 { 99 s3c24xx_irqc_regs_t *irqc_regs;100 95 gta02_scons_out = (void *) hw_map(GTA02_SCONS_BASE, PAGE_SIZE); 96 gta02_irqc = (void *) hw_map(S3C24XX_IRQC_ADDRESS, PAGE_SIZE); 101 97 gta02_timer = (void *) hw_map(S3C24XX_TIMER_ADDRESS, PAGE_SIZE); 102 irqc_regs = (void *) hw_map(S3C24XX_IRQC_ADDRESS, PAGE_SIZE); 103 104 /* Initialize interrupt controller. */ 105 s3c24xx_irqc_init(>a02_irqc, irqc_regs); 98 99 /* Make all interrupt sources use IRQ mode (not FIQ). */ 100 pio_write_32(>a02_irqc->intmod, 0x00000000); 101 102 /* Disable all interrupt sources. */ 103 pio_write_32(>a02_irqc->intmsk, 0xffffffff); 104 105 /* Disable interrupts from all sub-sources. */ 106 pio_write_32(>a02_irqc->intsubmsk, 0xffffffff); 106 107 } 107 108 … … 131 132 uint32_t inum; 132 133 133 /* Determine IRQ number. */ 134 inum = s3c24xx_irqc_inum_get(>a02_irqc); 135 136 /* Clear interrupt condition in the interrupt controller. */ 137 s3c24xx_irqc_clear(>a02_irqc, inum); 134 inum = pio_read_32(>a02_irqc->intoffset); 138 135 139 136 irq_t *irq = irq_dispatch_and_lock(inum); … … 147 144 CPU->id, inum); 148 145 } 146 147 /* Clear interrupt condition in the interrupt controller. */ 148 pio_write_32(>a02_irqc->srcpnd, S3C24XX_INT_BIT(inum)); 149 pio_write_32(>a02_irqc->intpnd, S3C24XX_INT_BIT(inum)); 149 150 } 150 151 … … 175 176 } 176 177 #endif 177 178 /* Initialize serial port of the debugging console. */ 179 s3c24xx_uart_io_t *scons_io; 180 181 scons_io = (void *) hw_map(GTA02_SCONS_BASE, PAGE_SIZE); 182 gta02_scons_dev = s3c24xx_uart_init(scons_io, S3C24XX_INT_UART2); 183 184 if (gta02_scons_dev) { 185 /* Create output device. */ 186 stdout_wire(gta02_scons_dev); 187 } 188 189 /* 190 * This is the necessary evil until the userspace driver is entirely 191 * self-sufficient. 192 */ 193 sysinfo_set_item_val("s3c24xx_uart", NULL, true); 194 sysinfo_set_item_val("s3c24xx_uart.inr", NULL, S3C24XX_INT_UART2); 195 sysinfo_set_item_val("s3c24xx_uart.address.physical", NULL, 196 (uintptr_t) GTA02_SCONS_BASE); 197 178 outdev_t *scons_dev; 179 180 scons_dev = s3c24xx_uart_init((ioport8_t *) gta02_scons_out); 181 if (scons_dev) 182 stdout_wire(scons_dev); 198 183 } 199 184 200 185 static void gta02_input_init(void) 201 186 { 202 s3c24xx_uart_t *scons_inst;203 204 if (gta02_scons_dev) {205 /* Create input device. */206 scons_inst = (void *) gta02_scons_dev->data;207 208 srln_instance_t *srln_instance = srln_init();209 if (srln_instance) {210 indev_t *sink = stdin_wire();211 indev_t *srln = srln_wire(srln_instance, sink);212 s3c24xx_uart_input_wire(scons_inst, srln);213 214 /* Enable interrupts from UART2 */215 s3c24xx_irqc_src_enable(>a02_irqc,216 S3C24XX_INT_UART2);217 218 /* Enable interrupts from UART2 RXD */219 s3c24xx_irqc_subsrc_enable(>a02_irqc,220 S3C24XX_SUBINT_RXD2);221 }222 }223 }224 225 size_t gta02_get_irq_count(void)226 {227 return GTA02_IRQ_COUNT;228 187 } 229 188 … … 289 248 290 249 /* Enable interrupts from timer0 */ 291 s3c24xx_irqc_src_enable(>a02_irqc, S3C24XX_INT_TIMER0); 250 pio_write_32(>a02_irqc->intmsk, pio_read_32(>a02_irqc->intmsk) & 251 ~S3C24XX_INT_BIT(S3C24XX_INT_TIMER0)); 292 252 293 253 /* Load data from tcntb0/tcmpb0 into tcnt0/tcmp0. */ -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
r9a1d8ab rdba4a23 64 64 icp_frame_init, 65 65 icp_output_init, 66 icp_input_init, 67 icp_get_irq_count 66 icp_input_init 68 67 }; 69 68 … … 337 336 } 338 337 339 size_t icp_get_irq_count(void)340 {341 return ICP_IRQ_COUNT;342 }343 338 344 339 /** @} -
kernel/arch/arm32/src/mach/testarm/testarm.c
r9a1d8ab rdba4a23 64 64 gxemul_frame_init, 65 65 gxemul_output_init, 66 gxemul_input_init, 67 gxemul_get_irq_count 66 gxemul_input_init 68 67 }; 69 68 … … 127 126 } 128 127 129 size_t gxemul_get_irq_count(void)130 {131 return GXEMUL_IRQ_COUNT;132 }133 134 128 /** Starts gxemul Real Time Clock device, which asserts regular interrupts. 135 129 * -
kernel/arch/arm32/src/machine_func.c
r9a1d8ab rdba4a23 128 128 size_t machine_get_irq_count(void) 129 129 { 130 return (machine_ops->machine_get_irq_count)(); 130 size_t irq_count; 131 132 #if defined(MACHINE_gta02) 133 irq_count = GTA02_IRQ_COUNT; 134 #elif defined(MACHINE_testarm) 135 irq_count = GXEMUL_IRQ_COUNT; 136 #elif defined(MACHINE_integratorcp) 137 irq_count = ICP_IRQ_COUNT; 138 #else 139 #error Machine type not defined. 140 #endif 141 return irq_count; 131 142 } 132 143 -
kernel/arch/ia32/src/mm/frame.c
r9a1d8ab rdba4a23 131 131 if (last_frame < ALIGN_UP(new_base + new_size, FRAME_SIZE)) 132 132 last_frame = ALIGN_UP(new_base + new_size, FRAME_SIZE); 133 } else if ((e820table[i].type == MEMMAP_MEMORY_ACPI) || 134 (e820table[i].type == MEMMAP_MEMORY_NVS)) { 133 } 134 135 if (e820table[i].type == MEMMAP_MEMORY_RESERVED) { 136 /* To be safe, make the reserved zone possibly larger */ 137 uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE); 138 uint64_t new_size = ALIGN_UP(size + (base - new_base), 139 FRAME_SIZE); 140 141 zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0, 142 ZONE_RESERVED); 143 } 144 145 if (e820table[i].type == MEMMAP_MEMORY_ACPI) { 135 146 /* To be safe, make the firmware zone possibly larger */ 136 147 uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE); … … 140 151 zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0, 141 152 ZONE_FIRMWARE); 142 } else {143 /* To be safe, make the reserved zone possibly larger */144 uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE);145 uint64_t new_size = ALIGN_UP(size + (base - new_base),146 FRAME_SIZE);147 148 zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,149 ZONE_RESERVED);150 153 } 151 154 } … … 200 203 #ifdef CONFIG_SMP 201 204 /* Reserve AP real mode bootstrap memory */ 202 frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 205 frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 203 206 (hardcoded_unmapped_ktext_size + 204 207 hardcoded_unmapped_kdata_size) >> FRAME_WIDTH); -
kernel/genarch/Makefile.inc
r9a1d8ab rdba4a23 90 90 endif 91 91 92 ifeq ($(CONFIG_S3C24XX_IRQC),y)93 GENARCH_SOURCES += \94 genarch/src/drivers/s3c24xx_irqc/s3c24xx_irqc.c95 endif96 97 92 ifeq ($(CONFIG_S3C24XX_UART),y) 98 93 GENARCH_SOURCES += \ -
kernel/genarch/include/drivers/s3c24xx_irqc/s3c24xx_irqc.h
r9a1d8ab rdba4a23 53 53 ioport32_t subsrcpnd; /**< Sub source pending */ 54 54 ioport32_t intsubmsk; /** Interrupt sub mask */ 55 } s3c24xx_irqc_ regs_t;55 } s3c24xx_irqc_t; 56 56 57 57 /** S3C24xx Interrupt source numbers. … … 120 120 #define S3C24XX_SUBINT_BIT(subsource) (1 << (subsource)) 121 121 122 typedef struct {123 s3c24xx_irqc_regs_t *regs;124 } s3c24xx_irqc_t;125 126 extern void s3c24xx_irqc_init(s3c24xx_irqc_t *, s3c24xx_irqc_regs_t *);127 extern unsigned s3c24xx_irqc_inum_get(s3c24xx_irqc_t *);128 extern void s3c24xx_irqc_clear(s3c24xx_irqc_t *, unsigned);129 extern void s3c24xx_irqc_src_enable(s3c24xx_irqc_t *, unsigned);130 extern void s3c24xx_irqc_src_disable(s3c24xx_irqc_t *, unsigned);131 extern void s3c24xx_irqc_subsrc_enable(s3c24xx_irqc_t *, unsigned);132 extern void s3c24xx_irqc_subsrc_disable(s3c24xx_irqc_t *, unsigned);133 134 122 #endif 135 123 -
kernel/genarch/include/drivers/s3c24xx_uart/s3c24xx_uart.h
r9a1d8ab rdba4a23 38 38 #define KERN_S3C24XX_UART_H_ 39 39 40 #include < ddi/irq.h>40 #include <typedefs.h> 41 41 #include <console/chardev.h> 42 #include <typedefs.h>43 42 44 /** S3C24xx UART I/O */ 45 typedef struct { 46 uint32_t ulcon; 47 uint32_t ucon; 48 uint32_t ufcon; 49 uint32_t umcon; 50 51 uint32_t utrstat; 52 uint32_t uerstat; 53 uint32_t ufstat; 54 uint32_t umstat; 55 56 uint32_t utxh; 57 uint32_t urxh; 58 59 uint32_t ubrdiv; 60 } s3c24xx_uart_io_t; 61 62 /** S3C24xx UART instance */ 63 typedef struct { 64 s3c24xx_uart_io_t *io; 65 indev_t *indev; 66 irq_t irq; 67 } s3c24xx_uart_t; 68 69 extern outdev_t *s3c24xx_uart_init(s3c24xx_uart_io_t *, inr_t inr); 70 extern void s3c24xx_uart_input_wire(s3c24xx_uart_t *, 71 indev_t *); 43 extern outdev_t *s3c24xx_uart_init(ioport8_t *); 72 44 73 45 #endif -
kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c
r9a1d8ab rdba4a23 40 40 #include <genarch/drivers/s3c24xx_uart/s3c24xx_uart.h> 41 41 #include <console/chardev.h> 42 #include <console/console.h>43 #include <ddi/device.h>44 42 #include <arch/asm.h> 45 43 #include <mm/slab.h> 44 #include <console/console.h> 46 45 #include <sysinfo/sysinfo.h> 47 46 #include <str.h> 48 47 49 /* Bits in UTRSTAT register*/50 #define S3C24XX_UTRSTAT _TX_EMPTY 0x451 #define S3C24XX_UT RSTAT_RDATA 0x148 /** S3C24xx UART register offsets */ 49 #define S3C24XX_UTRSTAT 0x10 50 #define S3C24XX_UTXH 0x20 52 51 53 #define S3C24XX_UFSTAT_TX_FULL 0x4000 54 #define S3C24XX_UFSTAT_RX_FULL 0x0040 55 #define S3C24XX_UFSTAT_RX_COUNT 0x002f 52 /* Bits in UTXH register */ 53 #define S3C24XX_UTXH_TX_EMPTY 0x4 54 55 typedef struct { 56 ioport8_t *base; 57 } s3c24xx_uart_instance_t; 56 58 57 59 static void s3c24xx_uart_sendb(outdev_t *dev, uint8_t byte) 58 60 { 59 s3c24xx_uart_t *uart = 60 (s3c24xx_uart_t *) dev->data; 61 s3c24xx_uart_instance_t *instance = 62 (s3c24xx_uart_instance_t *) dev->data; 63 ioport32_t *utrstat, *utxh; 61 64 62 /* Wait for space becoming available in Tx FIFO. */ 63 while ((pio_read_32(&uart->io->ufstat) & S3C24XX_UFSTAT_TX_FULL) != 0) 65 utrstat = (ioport32_t *) (instance->base + S3C24XX_UTRSTAT); 66 utxh = (ioport32_t *) (instance->base + S3C24XX_UTXH); 67 68 /* Wait for transmitter to be empty. */ 69 while ((pio_read_32(utrstat) & S3C24XX_UTXH_TX_EMPTY) == 0) 64 70 ; 65 71 66 pio_write_32( &uart->io->utxh, byte);72 pio_write_32(utxh, byte); 67 73 } 68 74 … … 80 86 } 81 87 82 static irq_ownership_t s3c24xx_uart_claim(irq_t *irq)83 {84 return IRQ_ACCEPT;85 }86 87 static void s3c24xx_uart_irq_handler(irq_t *irq)88 {89 s3c24xx_uart_t *uart = irq->instance;90 91 while ((pio_read_32(&uart->io->ufstat) & S3C24XX_UFSTAT_RX_COUNT) != 0) {92 uint32_t data = pio_read_32(&uart->io->urxh);93 pio_read_32(&uart->io->uerstat);94 indev_push_character(uart->indev, data & 0xff);95 }96 }97 98 88 static outdev_operations_t s3c24xx_uart_ops = { 99 89 .write = s3c24xx_uart_putchar, … … 101 91 }; 102 92 103 outdev_t *s3c24xx_uart_init( s3c24xx_uart_io_t *io, inr_t inr)93 outdev_t *s3c24xx_uart_init(ioport8_t *base) 104 94 { 105 95 outdev_t *uart_dev = malloc(sizeof(outdev_t), FRAME_ATOMIC); … … 107 97 return NULL; 108 98 109 s3c24xx_uart_ t *uart=110 malloc(sizeof(s3c24xx_uart_ t), FRAME_ATOMIC);111 if (! uart) {99 s3c24xx_uart_instance_t *instance = 100 malloc(sizeof(s3c24xx_uart_instance_t), FRAME_ATOMIC); 101 if (!instance) { 112 102 free(uart_dev); 113 103 return NULL; … … 115 105 116 106 outdev_initialize("s3c24xx_uart_dev", uart_dev, &s3c24xx_uart_ops); 117 uart_dev->data = uart;107 uart_dev->data = instance; 118 108 119 uart->io = io; 120 uart->indev = NULL; 121 122 /* Initialize IRQ structure. */ 123 irq_initialize(&uart->irq); 124 uart->irq.devno = device_assign_devno(); 125 uart->irq.inr = inr; 126 uart->irq.claim = s3c24xx_uart_claim; 127 uart->irq.handler = s3c24xx_uart_irq_handler; 128 uart->irq.instance = uart; 129 130 /* Enable FIFO, Tx trigger level: empty, Rx trigger level: 1 byte. */ 131 pio_write_32(&uart->io->ufcon, 0x01); 132 133 /* Set RX interrupt to pulse mode */ 134 pio_write_32(&uart->io->ucon, 135 pio_read_32(&uart->io->ucon) & ~(1 << 8)); 109 instance->base = base; 136 110 137 111 if (!fb_exported) { … … 142 116 sysinfo_set_item_val("fb", NULL, true); 143 117 sysinfo_set_item_val("fb.kind", NULL, 3); 144 sysinfo_set_item_val("fb.address.physical", NULL, KA2PA( io));118 sysinfo_set_item_val("fb.address.physical", NULL, KA2PA(base)); 145 119 146 120 fb_exported = true; … … 150 124 } 151 125 152 void s3c24xx_uart_input_wire(s3c24xx_uart_t *uart, indev_t *indev)153 {154 ASSERT(uart);155 ASSERT(indev);156 157 uart->indev = indev;158 irq_register(&uart->irq);159 }160 161 126 /** @} 162 127 */ -
kernel/generic/src/mm/frame.c
r9a1d8ab rdba4a23 161 161 for (j = zones.count; j > i; j--) { 162 162 zones.info[j] = zones.info[j - 1]; 163 if (zones.info[j].buddy_system != NULL) 164 zones.info[j].buddy_system->data = 165 (void *) &zones.info[j]; 163 zones.info[j].buddy_system->data = 164 (void *) &zones.info[j - 1]; 166 165 } 167 166 … … 763 762 for (i = z2 + 1; i < zones.count; i++) { 764 763 zones.info[i - 1] = zones.info[i]; 765 if (zones.info[i - 1].buddy_system != NULL) 766 zones.info[i - 1].buddy_system->data = 767 (void *) &zones.info[i - 1]; 764 zones.info[i - 1].buddy_system->data = 765 (void *) &zones.info[i - 1]; 768 766 } 769 767 -
tools/mkfat.py
r9a1d8ab rdba4a23 343 343 def usage(prname): 344 344 "Print usage syntax" 345 print prname + " < EXTRA_BYTES> <PATH> <IMAGE>"345 print prname + " <PATH> <IMAGE>" 346 346 347 347 def main(): 348 if (len(sys.argv) < 4):348 if (len(sys.argv) < 3): 349 349 usage(sys.argv[0]) 350 350 return 351 351 352 if (not sys.argv[1].isdigit()): 353 print "<EXTRA_BYTES> must be a number" 354 return 355 356 extra_bytes = int(sys.argv[1]) 357 358 path = os.path.abspath(sys.argv[2]) 352 path = os.path.abspath(sys.argv[1]) 359 353 if (not os.path.isdir(path)): 360 354 print "<PATH> must be a directory" … … 371 365 372 366 # Make sure the filesystem is large enought for FAT16 373 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes367 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size 374 368 while (size / cluster_size < fat16_clusters): 375 369 if (cluster_size > sector_size): 376 370 cluster_size /= 2 377 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes371 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size 378 372 else: 379 373 size = fat16_clusters * cluster_size + reserved_clusters * cluster_size … … 387 381 data_start = root_start + root_size 388 382 389 outf = file(sys.argv[ 3], "w")383 outf = file(sys.argv[2], "w") 390 384 391 385 boot_sector = xstruct.create(BOOT_SECTOR) -
uspace/Makefile
r9a1d8ab rdba4a23 69 69 srv/hid/kbd \ 70 70 srv/hw/char/i8042 \ 71 srv/hw/char/s3c24xx_uart \72 71 srv/hw/netif/dp8390 \ 73 72 srv/net/cfg \ -
uspace/Makefile.common
r9a1d8ab rdba4a23 172 172 ifneq ($(BINARY),) 173 173 %.disasm: $(BINARY) 174 ifeq ($(CONFIG_LINE_DEBUG),y)175 $(OBJDUMP) -d -S $< > $@176 else177 174 $(OBJDUMP) -d $< > $@ 178 endif179 175 180 176 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS) -
uspace/app/init/init.c
r9a1d8ab rdba4a23 274 274 srv_start("/srv/cuda_adb"); 275 275 srv_start("/srv/i8042"); 276 srv_start("/srv/s3c24ser");277 276 srv_start("/srv/adb_ms"); 278 277 srv_start("/srv/char_ms"); -
uspace/app/klog/klog.c
r9a1d8ab rdba4a23 43 43 #include <event.h> 44 44 #include <errno.h> 45 #include <str_error.h>46 45 #include <io/klog.h> 47 46 48 #define NAME "klog" 49 #define LOG_FNAME "/log/klog" 47 #define NAME "klog" 50 48 51 49 /* Pointer to klog area */ 52 50 static wchar_t *klog; 53 51 static size_t klog_length; 54 55 static FILE *log;56 52 57 53 static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) … … 62 58 size_t i; 63 59 64 for (i = klog_len - klog_stored; i < klog_len; i++) { 65 wchar_t ch = klog[(klog_start + i) % klog_length]; 66 67 putchar(ch); 68 69 if (log != NULL) 70 fputc(ch, log); 71 } 72 73 if (log != NULL) { 74 fflush(log); 75 fsync(fileno(log)); 76 } 60 for (i = klog_len - klog_stored; i < klog_len; i++) 61 putchar(klog[(klog_start + i) % klog_length]); 77 62 } 78 63 … … 106 91 } 107 92 108 /*109 * Mode "a" would be definitively much better here, but it is110 * not well supported by the FAT driver.111 *112 */113 log = fopen(LOG_FNAME, "w");114 if (log == NULL)115 printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME,116 str_error(errno));117 118 93 async_set_interrupt_received(interrupt_received); 119 94 klog_update(); -
uspace/lib/c/generic/io/io.c
r9a1d8ab rdba4a23 757 757 } 758 758 759 int fileno(FILE *stream)760 {761 if (stream->klog) {762 errno = EBADF;763 return -1;764 }765 766 return stream->fd;767 }768 769 759 int fphone(FILE *stream) 770 760 { -
uspace/lib/c/include/stdio.h
r9a1d8ab rdba4a23 171 171 extern off64_t ftell(FILE *); 172 172 extern int feof(FILE *); 173 extern int fileno(FILE *);174 173 175 174 extern int fflush(FILE *); -
uspace/srv/fs/fat/fat_ops.c
r9a1d8ab rdba4a23 1527 1527 void fat_sync(ipc_callid_t rid, ipc_call_t *request) 1528 1528 { 1529 dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 1530 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1531 1532 fs_node_t *fn; 1533 int rc = fat_node_get(&fn, dev_handle, index); 1534 if (rc != EOK) { 1535 ipc_answer_0(rid, rc); 1536 return; 1537 } 1538 if (!fn) { 1539 ipc_answer_0(rid, ENOENT); 1540 return; 1541 } 1542 1543 fat_node_t *nodep = FAT_NODE(fn); 1544 1545 nodep->dirty = true; 1546 rc = fat_node_sync(nodep); 1547 1548 fat_node_put(fn); 1549 ipc_answer_0(rid, rc); 1529 /* Dummy implementation */ 1530 ipc_answer_0(rid, EOK); 1550 1531 } 1551 1532 -
uspace/srv/fs/tmpfs/tmpfs_ops.c
r9a1d8ab rdba4a23 736 736 void tmpfs_sync(ipc_callid_t rid, ipc_call_t *request) 737 737 { 738 /* 739 * TMPFS keeps its data structures always consistent, 740 * thus the sync operation is a no-op. 741 */ 738 /* Dummy implementation */ 742 739 ipc_answer_0(rid, EOK); 743 740 } -
uspace/srv/hid/kbd/Makefile
r9a1d8ab rdba4a23 60 60 ifeq ($(MACHINE),gta02) 61 61 SOURCES += \ 62 port/ chardev.c \63 ctl/ stty.c62 port/dummy.c \ 63 ctl/pc.c 64 64 endif 65 65 ifeq ($(MACHINE),testarm) -
uspace/srv/hid/kbd/port/chardev.c
r9a1d8ab rdba4a23 41 41 #include <kbd.h> 42 42 #include <vfs/vfs.h> 43 #include <sys/stat.h>44 43 #include <fcntl.h> 45 44 #include <errno.h> … … 51 50 #define NAME "kbd" 52 51 53 /** List of devices to try connecting to. */54 static const char *in_devs[] = {55 "/dev/char/ps2a",56 "/dev/char/s3c24ser"57 };58 59 static const int num_devs = sizeof(in_devs) / sizeof(in_devs[0]);60 61 52 int kbd_port_init(void) 62 53 { 54 const char *input = "/dev/char/ps2a"; 63 55 int input_fd; 64 int i;65 56 66 input_fd = -1; 67 for (i = 0; i < num_devs; i++) { 68 struct stat s; 57 printf(NAME ": open %s\n", input); 69 58 70 if (stat(in_devs[i], &s) == EOK) 71 break; 72 } 73 74 if (i >= num_devs) { 75 printf(NAME ": Could not find any suitable input device.\n"); 76 return -1; 77 } 78 79 input_fd = open(in_devs[i], O_RDONLY); 59 input_fd = open(input, O_RDONLY); 80 60 if (input_fd < 0) { 81 printf(NAME ": failed opening device %s (%d).\n", in_devs[i], 82 input_fd); 83 return -1; 61 printf(NAME ": Failed opening %s (%d)\n", input, input_fd); 62 return false; 84 63 } 85 64 86 65 dev_phone = fd_phone(input_fd); 87 66 if (dev_phone < 0) { 88 printf(NAME ": Failed connectingto device\n");89 return -1;67 printf(NAME ": Failed to connect to device\n"); 68 return false; 90 69 } 91 70 … … 94 73 if (ipc_connect_to_me(dev_phone, 0, 0, 0, &phonehash) != 0) { 95 74 printf(NAME ": Failed to create callback from device\n"); 96 return -1;75 return false; 97 76 } 98 77
Note:
See TracChangeset
for help on using the changeset viewer.