Rev 3672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3672 | Rev 3908 | ||
---|---|---|---|
Line 95... | Line 95... | ||
95 | * Initializes the SGCN driver. |
95 | * Initializes the SGCN driver. |
96 | * Maps the physical memory (SRAM) and registers the interrupt. |
96 | * Maps the physical memory (SRAM) and registers the interrupt. |
97 | */ |
97 | */ |
98 | void sgcn_init(void) |
98 | void sgcn_init(void) |
99 | { |
99 | { |
100 | sram_virt_addr = (uintptr_t) as_get_mappable_page( |
100 | sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); |
101 | sysinfo_value("sram.area.size")); |
- | |
102 | int result = physmem_map( |
- | |
103 | (void *) sysinfo_value("sram.address.physical"), |
101 | if (physmem_map((void *) sysinfo_value("sram.address.physical"), |
104 | (void *) sram_virt_addr, |
- | |
105 | sysinfo_value("sram.area.size") / PAGE_SIZE, |
102 | (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, |
106 | AS_AREA_READ | AS_AREA_WRITE |
103 | AS_AREA_READ | AS_AREA_WRITE) != 0) |
107 | ); |
- | |
108 | if (result != 0) { |
- | |
109 | printf("SGCN: uspace driver could not map physical memory."); |
104 | printf("SGCN: uspace driver could not map physical memory."); |
110 | } |
- | |
111 | 105 | ||
112 | sram_buffer_offset = sysinfo_value("sram.buffer.offset"); |
106 | sram_buffer_offset = sysinfo_value("sram.buffer.offset"); |
113 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), |
107 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), |
114 | 0, (void *) 0); |
108 | 0, (void *) 0); |
115 | } |
109 | } |