Changeset fd375a8d in mainline
- Timestamp:
- 2009-02-03T13:50:26Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 753d851
- Parents:
- eddf924
- Location:
- boot
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc32/loader/main.c
reddf924 rfd375a8d 177 177 fix_overlap(&bootinfo, &bootinfo_pa, "boot info", &top); 178 178 179 ofw_setup_palette(); 180 179 181 printf("\nBooting the kernel...\n"); 180 182 jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa, (void *) bootinfo.screen.addr, bootinfo.screen.scanline); -
boot/arch/sparc64/loader/main.c
reddf924 rfd375a8d 270 270 #endif 271 271 272 setup_palette();272 ofw_setup_palette(); 273 273 274 274 printf("\nBooting the kernel...\n"); -
boot/genarch/ofw.c
reddf924 rfd375a8d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 29 #include <ofw.h> 30 30 #include <ofwarch.h> … … 373 373 } 374 374 375 #define RED(i) (((i) >> 5) & ((1 << 3) - 1)) 376 #define GREEN(i) (((i) >> 3) & ((1 << 2) - 1)) 377 #define BLUE(i) ((i) & ((1 << 3) - 1)) 378 #define CLIP(i) ((i) <= 255 ? (i) : 255) 379 380 375 381 /** 376 382 * Sets up the palette for the 8-bit color depth configuration so that the 377 383 * 3:2:3 color scheme can be used. Checks that setting the palette makes sense 378 384 * (appropriate nodes exist in the OBP tree and the color depth is not greater 379 * than 8). 380 * 381 * @return true if the palette has been set, false otherwise 385 * than 8). 386 * 387 * @return true if the palette has been set, false otherwise 388 * 382 389 */ 383 int setup_palette(void)390 int ofw_setup_palette(void) 384 391 { 385 392 char device_name[BUF_SIZE]; … … 387 394 /* resolve alias */ 388 395 if (ofw_get_property(ofw_aliases, "screen", device_name, 389 390 return false; 391 396 sizeof(device_name)) <= 0) 397 return false; 398 392 399 /* for depth greater than 8 it makes no sense to set up the palette */ 393 400 uint32_t depth; … … 404 411 if (screen == -1) 405 412 return false; 406 413 407 414 /* setup the palette so that the (inverted) 3:2:3 scheme is usable */ 408 415 unsigned int i; 409 416 for (i = 0; i < 256; i++) 410 if (ofw_call("call-method", 6, 1, NULL, "color!", screen, 411 255 - i, 412 i << 5, 413 (i >> 3) << 6, 414 (i >> 5) << 5) != 0); 417 ofw_call("call-method", 6, 1, NULL, "color!", screen, 418 255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37)); 415 419 return true; 416 420 } -
boot/genarch/ofw.h
reddf924 rfd375a8d 124 124 extern int ofw_screen(screen_t *screen); 125 125 extern int ofw_macio(macio_t *macio); 126 extern int setup_palette(void);126 extern int ofw_setup_palette(void); 127 127 extern void ofw_quiesce(void); 128 128 -
boot/tools/ia32/gen_vga323.c
reddf924 rfd375a8d 1 /* 2 * Copyright (c) 2008 Martin Decky 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 1 29 #include <stdio.h> 2 30 3 #define RED(i) ((i>> 5) & ((1 << 3) - 1))4 #define GREEN(i) ((i>> 3) & ((1 << 2) - 1))5 #define BLUE(i) (i& ((1 << 3) - 1))31 #define RED(i) (((i) >> 5) & ((1 << 3) - 1)) 32 #define GREEN(i) (((i) >> 3) & ((1 << 2) - 1)) 33 #define BLUE(i) ((i) & ((1 << 3) - 1)) 6 34 7 35 int main(int argc, char *argv[]) {
Note:
See TracChangeset
for help on using the changeset viewer.