Changeset 89128f3 in mainline for kernel


Ignore:
Timestamp:
2011-12-08T23:12:14Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c986d3
Parents:
b25199bc (diff), c40f385 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
kernel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/boot/multiboot2.S

    rb25199bc r89128f3  
    5555                .long MULTIBOOT2_TAG_MODULE
    5656                .long MULTIBOOT2_TAG_MEMMAP
     57#ifdef CONFIG_FB
    5758                .long MULTIBOOT2_TAG_FBINFO
     59#endif
    5860        tag_info_req_end:
    5961       
     
    8587        tag_flags_end:
    8688       
     89#ifdef CONFIG_FB
    8790        /* Framebuffer tag */
    8891        tag_framebuffer_start:
     
    9497                .long CONFIG_BFB_BPP
    9598        tag_framebuffer_end:
     99#endif
    96100       
    97101        /* Module alignment tag */
  • kernel/arch/ia32/src/boot/multiboot2.S

    rb25199bc r89128f3  
    5353                .long MULTIBOOT2_TAG_MODULE
    5454                .long MULTIBOOT2_TAG_MEMMAP
     55#ifdef CONFIG_FB
    5556                .long MULTIBOOT2_TAG_FBINFO
     57#endif
    5658        tag_info_req_end:
    5759       
     
    8385        tag_flags_end:
    8486       
     87#ifdef CONFIG_FB
    8588        /* Framebuffer tag */
    8689        tag_framebuffer_start:
     
    9295                .long CONFIG_BFB_BPP
    9396        tag_framebuffer_end:
     97#endif
    9498       
    9599        /* Module alignment tag */
  • kernel/genarch/src/drivers/i8042/i8042.c

    rb25199bc r89128f3  
    4444#include <mm/slab.h>
    4545#include <ddi/device.h>
     46#include <time/delay.h>
    4647
    4748#define i8042_SET_COMMAND  0x60
     
    5152#define i8042_BUFFER_FULL_MASK  0x01
    5253#define i8042_WAIT_MASK         0x02
     54
     55#define i8042_TIMEOUT  65536
    5356
    5457static irq_ownership_t i8042_claim(irq_t *irq)
     
    7780static void i8042_clear_buffer(i8042_t *dev)
    7881{
    79         while (pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK)
     82        for (uint32_t i = 0; i < i8042_TIMEOUT; i++) {
     83                if ((pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) == 0)
     84                        break;
     85               
    8086                (void) pio_read_8(&dev->data);
     87                delay(50);  /* 50 us think time */
     88        }
     89}
     90
     91static void i8042_send_command(i8042_t *dev, uint8_t cmd)
     92{
     93        for (uint32_t i = 0; i < i8042_TIMEOUT; i++) {
     94                if ((pio_read_8(&dev->status) & i8042_WAIT_MASK) == 0)
     95                        break;
     96               
     97                delay(50);  /* 50 us think time */
     98        }
     99       
     100        pio_write_8(&dev->status, cmd);
     101        delay(10000);  /* 10 ms think time */
    81102}
    82103
     
    84105i8042_instance_t *i8042_init(i8042_t *dev, inr_t inr)
    85106{
    86         i8042_instance_t *instance
    87             = malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);
     107        i8042_instance_t *instance =
     108            malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);
    88109        if (instance) {
    89110                instance->i8042 = dev;
     
    96117                instance->irq.handler = i8042_irq_handler;
    97118                instance->irq.instance = instance;
    98                
    99119        }
    100120       
     
    107127        ASSERT(kbrdin);
    108128       
     129        i8042_clear_buffer(instance->i8042);
     130       
    109131        instance->kbrdin = kbrdin;
    110132        irq_register(&instance->irq);
    111         i8042_clear_buffer(instance->i8042);
    112133}
    113134
     
    116137{
    117138        interrupts_disable();
    118        
    119139        i8042_clear_buffer(dev);
    120        
    121         /* Reset CPU */
    122         pio_write_8(&dev->status, i8042_CPU_RESET);
     140        i8042_send_command(dev, i8042_CPU_RESET);
    123141}
    124142
  • kernel/genarch/src/fb/bfb.c

    rb25199bc r89128f3  
    4040#include <console/console.h>
    4141
    42 uintptr_t bfb_addr = (uintptr_t) -1;
     42uintptr_t bfb_addr = 0;
    4343uint32_t bfb_width = 0;
    4444uint32_t bfb_height = 0;
     
    5757bool bfb_init(void)
    5858{
    59         if ((bfb_width == 0) || (bfb_height == 0))
     59        if ((bfb_addr == 0) || (bfb_width == 0) || (bfb_height == 0) ||
     60            (bfb_bpp == 0) || (bfb_scanline == 0))
    6061                return false;
    6162       
  • kernel/genarch/src/multiboot/multiboot2.c

    rb25199bc r89128f3  
    7676static void multiboot2_fbinfo(const multiboot2_fbinfo_t *fbinfo)
    7777{
     78#ifdef CONFIG_FB
    7879        if (fbinfo->visual == MULTIBOOT2_VISUAL_RGB) {
    7980                bfb_addr = fbinfo->addr;
     
    9293                bfb_blue_size = fbinfo->rgb.blue_size;
    9394        }
     95#endif
    9496}
    9597
  • kernel/generic/src/main/main.c

    rb25199bc r89128f3  
    262262         * Create the first thread.
    263263         */
    264         thread_t *kinit_thread
    265                 = thread_create(kinit, NULL, kernel, 0, "kinit", true);
     264        thread_t *kinit_thread =
     265            thread_create(kinit, NULL, kernel, 0, "kinit", true);
    266266        if (!kinit_thread)
    267267                panic("Cannot create kinit thread.");
Note: See TracChangeset for help on using the changeset viewer.