···12#include "ppc_asm.h"1314 .text15+ /* a procedure descriptor used when booting this as a COFF file */16+_zimage_start_opd:17+ .long _zimage_start, 0, 0, 018+19 .globl _zimage_start20_zimage_start:21+ /* Work out the offset between the address we were linked at22+ and the address where we're running. */23 bl 1f24+1: mflr r00025 lis r9,1b@ha26 addi r9,r9,1b@l27 subf. r0,r9,r028+ beq 3f /* if running at same address as linked */2930+ /* The .got2 section contains a list of addresses, so add31+ the address offset onto each entry. */32 lis r9,__got2_start@ha33 addi r9,r9,__got2_start@l34 lis r8,__got2_end@ha···32 srwi. r8,r8,233 mtctr r834 add r9,r0,r935+2: lwz r8,0(r9)036 add r8,r8,r037 stw r8,0(r9)38 addi r9,r9,439 bdnz 2b4041+ /* Do a cache flush for our text, in case OF didn't */42+3: lis r9,_start@h43 add r9,r0,r944 lis r8,_etext@ha45 addi r8,r8,_etext@l
···1+/*2+ * hack-coff.c - hack the header of an xcoff file to fill in3+ * a few fields needed by the Open Firmware xcoff loader on4+ * Power Macs but not initialized by objcopy.5+ *6+ * Copyright (C) Paul Mackerras 1997.7+ *8+ * This program is free software; you can redistribute it and/or9+ * modify it under the terms of the GNU General Public License10+ * as published by the Free Software Foundation; either version11+ * 2 of the License, or (at your option) any later version.12+ */13+#include <stdio.h>14+#include <stdlib.h>15+#include <unistd.h>16+#include <fcntl.h>17+#include <string.h>18+#include "rs6000.h"19+20+#define AOUT_MAGIC 0x010b21+22+#define get_16be(x) ((((unsigned char *)(x))[0] << 8) \23+ + ((unsigned char *)(x))[1])24+#define put_16be(x, v) (((unsigned char *)(x))[0] = (v) >> 8, \25+ ((unsigned char *)(x))[1] = (v) & 0xff)26+#define get_32be(x) ((((unsigned char *)(x))[0] << 24) \27+ + (((unsigned char *)(x))[1] << 16) \28+ + (((unsigned char *)(x))[2] << 8) \29+ + ((unsigned char *)(x))[3])30+31+int32+main(int ac, char **av)33+{34+ int fd;35+ int i, nsect;36+ int aoutsz;37+ struct external_filehdr fhdr;38+ AOUTHDR aout;39+ struct external_scnhdr shdr;40+41+ if (ac != 2) {42+ fprintf(stderr, "Usage: hack-coff coff-file\n");43+ exit(1);44+ }45+ if ((fd = open(av[1], 2)) == -1) {46+ perror(av[2]);47+ exit(1);48+ }49+ if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr))50+ goto readerr;51+ i = get_16be(fhdr.f_magic);52+ if (i != U802TOCMAGIC && i != U802WRMAGIC && i != U802ROMAGIC) {53+ fprintf(stderr, "%s: not an xcoff file\n", av[1]);54+ exit(1);55+ }56+ aoutsz = get_16be(fhdr.f_opthdr);57+ if (read(fd, &aout, aoutsz) != aoutsz)58+ goto readerr;59+ nsect = get_16be(fhdr.f_nscns);60+ for (i = 0; i < nsect; ++i) {61+ if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))62+ goto readerr;63+ if (strcmp(shdr.s_name, ".text") == 0) {64+ put_16be(aout.o_snentry, i+1);65+ put_16be(aout.o_sntext, i+1);66+ } else if (strcmp(shdr.s_name, ".data") == 0) {67+ put_16be(aout.o_sndata, i+1);68+ } else if (strcmp(shdr.s_name, ".bss") == 0) {69+ put_16be(aout.o_snbss, i+1);70+ }71+ }72+ put_16be(aout.magic, AOUT_MAGIC);73+ if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -174+ || write(fd, &aout, aoutsz) != aoutsz) {75+ fprintf(stderr, "%s: write error\n", av[1]);76+ exit(1);77+ }78+ close(fd);79+ exit(0);80+81+readerr:82+ fprintf(stderr, "%s: read error or file too short\n", av[1]);83+ exit(1);84+}
+22-24
arch/powerpc/boot/main.c
···212223/* Value picked to match that used by yaboot */24-#define PROG_START 0x0140000025-#define RAM_END (512<<20) // Fixme: use OF */26#define ONE_MB 0x1000002728extern char _start[];···160 elfoffset = (unsigned long)elf64ph->p_offset;161 vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset;162 vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset;00000000000163 return 1;164}165···217 exit();218 if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)219 exit();220- stderr = stdout;221- if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)222- exit();223224 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp);000000000225226 vmlinuz.addr = (unsigned long)_vmlinux_start;227 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);···244 printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r");245 exit();246 }247-248- /*249- * The first available claim_base must be above the end of the250- * the loaded kernel wrapper file (_start to _end includes the251- * initrd image if it is present) and rounded up to a nice252- * 1 MB boundary for good measure.253- */254-255- claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);256-257-#if defined(PROG_START)258- /*259- * Maintain a "magic" minimum address. This keeps some older260- * firmware platforms running.261- */262-263- if (claim_base < PROG_START)264- claim_base = PROG_START;265-#endif266267 /* We need to claim the memsize plus the file offset since gzip268 * will expand the header (file offset), then the kernel, then
···212223/* Value picked to match that used by yaboot */24+#define PROG_START 0x01400000 /* only used on 64-bit systems */25+#define RAM_END (512<<20) /* Fixme: use OF */26#define ONE_MB 0x1000002728extern char _start[];···160 elfoffset = (unsigned long)elf64ph->p_offset;161 vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset;162 vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset;163+164+#if defined(PROG_START)165+ /*166+ * Maintain a "magic" minimum address. This keeps some older167+ * firmware platforms running.168+ */169+170+ if (claim_base < PROG_START)171+ claim_base = PROG_START;172+#endif173+174 return 1;175}176···206 exit();207 if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)208 exit();000209210 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp);211+212+ /*213+ * The first available claim_base must be above the end of the214+ * the loaded kernel wrapper file (_start to _end includes the215+ * initrd image if it is present) and rounded up to a nice216+ * 1 MB boundary for good measure.217+ */218+219+ claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);220221 vmlinuz.addr = (unsigned long)_vmlinux_start;222 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);···227 printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r");228 exit();229 }0000000000000000000230231 /* We need to claim the memsize plus the file offset since gzip232 * will expand the header (file offset), then the kernel, then
+111-445
arch/powerpc/boot/prom.c
···13#include "prom.h"1415int (*prom)(void *);001617-void *chosen_handle;18-19-void *stdin;20-void *stdout;21-void *stderr;22-23-24-int25-write(void *handle, void *ptr, int nb)26{027 struct prom_args {28- char *service;29 int nargs;30 int nret;31- void *ihandle;32- void *addr;33- int len;34- int actual;35 } args;03637- args.service = "write";38- args.nargs = 3;39- args.nret = 1;40- args.ihandle = handle;41- args.addr = ptr;42- args.len = nb;43- args.actual = -1;44- (*prom)(&args);45- return args.actual;000000046}4748-int49-read(void *handle, void *ptr, int nb)50{051 struct prom_args {52- char *service;53 int nargs;54 int nret;55- void *ihandle;56- void *addr;57- int len;58- int actual;59 } args;06061- args.service = "read";62- args.nargs = 3;63- args.nret = 1;64- args.ihandle = handle;65- args.addr = ptr;66- args.len = nb;67- args.actual = -1;68- (*prom)(&args);69- return args.actual;0000000000070}7172-void73-exit()74{75- struct prom_args {76- char *service;77- } args;78-79- for (;;) {80- args.service = "exit";81- (*prom)(&args);82- }83}8485-void86-pause(void)87-{88- struct prom_args {89- char *service;90- } args;91-92- args.service = "enter";93- (*prom)(&args);94-}95-96-void *97-finddevice(const char *name)98-{99- struct prom_args {100- char *service;101- int nargs;102- int nret;103- const char *devspec;104- void *phandle;105- } args;106-107- args.service = "finddevice";108- args.nargs = 1;109- args.nret = 1;110- args.devspec = name;111- args.phandle = (void *) -1;112- (*prom)(&args);113- return args.phandle;114-}115-116-void *117-claim(unsigned long virt, unsigned long size, unsigned long align)118-{119- struct prom_args {120- char *service;121- int nargs;122- int nret;123- unsigned int virt;124- unsigned int size;125- unsigned int align;126- void *ret;127- } args;128-129- args.service = "claim";130- args.nargs = 3;131- args.nret = 1;132- args.virt = virt;133- args.size = size;134- args.align = align;135- (*prom)(&args);136- return args.ret;137-}138-139-int140-getprop(void *phandle, const char *name, void *buf, int buflen)141-{142- struct prom_args {143- char *service;144- int nargs;145- int nret;146- void *phandle;147- const char *name;148- void *buf;149- int buflen;150- int size;151- } args;152-153- args.service = "getprop";154- args.nargs = 4;155- args.nret = 1;156- args.phandle = phandle;157- args.name = name;158- args.buf = buf;159- args.buflen = buflen;160- args.size = -1;161- (*prom)(&args);162- return args.size;163-}164-165-int166-putc(int c, void *f)167-{168- char ch = c;169-170- if (c == '\n')171- putc('\r', f);172- return write(f, &ch, 1) == 1? c: -1;173-}174-175-int176-putchar(int c)177-{178- return putc(c, stdout);179-}180-181-int182-fputs(char *str, void *f)183-{184- int n = strlen(str);185-186- return write(f, str, n) == n? 0: -1;187-}188-189-size_t strnlen(const char * s, size_t count)190-{191- const char *sc;192-193- for (sc = s; count-- && *sc != '\0'; ++sc)194- /* nothing */;195- return sc - s;196-}197-198-extern unsigned int __div64_32(unsigned long long *dividend,199- unsigned int divisor);200-201-/* The unnecessary pointer compare is there202- * to check for type safety (n must be 64bit)203 */204-# define do_div(n,base) ({ \205- unsigned int __base = (base); \206- unsigned int __rem; \207- (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \208- if (((n) >> 32) == 0) { \209- __rem = (unsigned int)(n) % __base; \210- (n) = (unsigned int)(n) / __base; \211- } else \212- __rem = __div64_32(&(n), __base); \213- __rem; \214- })215216-static int skip_atoi(const char **s)0217{218- int i, c;219-220- for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s)221- i = i*10 + c - '0';222- return i;223}224225-#define ZEROPAD 1 /* pad with zero */226-#define SIGN 2 /* unsigned/signed long */227-#define PLUS 4 /* show plus */228-#define SPACE 8 /* space if plus */229-#define LEFT 16 /* left justified */230-#define SPECIAL 32 /* 0x */231-#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */232-233-static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)234{235- char c,sign,tmp[66];236- const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";237- int i;238239- if (type & LARGE)240- digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";241- if (type & LEFT)242- type &= ~ZEROPAD;243- if (base < 2 || base > 36)244 return 0;245- c = (type & ZEROPAD) ? '0' : ' ';246- sign = 0;247- if (type & SIGN) {248- if ((signed long long)num < 0) {249- sign = '-';250- num = - (signed long long)num;251- size--;252- } else if (type & PLUS) {253- sign = '+';254- size--;255- } else if (type & SPACE) {256- sign = ' ';257- size--;258 }259 }260- if (type & SPECIAL) {261- if (base == 16)262- size -= 2;263- else if (base == 8)264- size--;265 }266- i = 0;267- if (num == 0)268- tmp[i++]='0';269- else while (num != 0) {270- tmp[i++] = digits[do_div(num, base)];271- }272- if (i > precision)273- precision = i;274- size -= precision;275- if (!(type&(ZEROPAD+LEFT)))276- while(size-->0)277- *str++ = ' ';278- if (sign)279- *str++ = sign;280- if (type & SPECIAL) {281- if (base==8)282- *str++ = '0';283- else if (base==16) {284- *str++ = '0';285- *str++ = digits[33];286 }287 }288- if (!(type & LEFT))289- while (size-- > 0)290- *str++ = c;291- while (i < precision--)292- *str++ = '0';293- while (i-- > 0)294- *str++ = tmp[i];295- while (size-- > 0)296- *str++ = ' ';297- return str;298}299300-int vsprintf(char *buf, const char *fmt, va_list args)301{302- int len;303- unsigned long long num;304- int i, base;305- char * str;306- const char *s;307308- int flags; /* flags to number() */309-310- int field_width; /* width of output field */311- int precision; /* min. # of digits for integers; max312- number of chars for from string */313- int qualifier; /* 'h', 'l', or 'L' for integer fields */314- /* 'z' support added 23/7/1999 S.H. */315- /* 'z' changed to 'Z' --davidm 1/25/99 */316-317318- for (str=buf ; *fmt ; ++fmt) {319- if (*fmt != '%') {320- *str++ = *fmt;321- continue;322- }323-324- /* process flags */325- flags = 0;326- repeat:327- ++fmt; /* this also skips first '%' */328- switch (*fmt) {329- case '-': flags |= LEFT; goto repeat;330- case '+': flags |= PLUS; goto repeat;331- case ' ': flags |= SPACE; goto repeat;332- case '#': flags |= SPECIAL; goto repeat;333- case '0': flags |= ZEROPAD; goto repeat;334- }335-336- /* get field width */337- field_width = -1;338- if ('0' <= *fmt && *fmt <= '9')339- field_width = skip_atoi(&fmt);340- else if (*fmt == '*') {341- ++fmt;342- /* it's the next argument */343- field_width = va_arg(args, int);344- if (field_width < 0) {345- field_width = -field_width;346- flags |= LEFT;347- }348- }349-350- /* get the precision */351- precision = -1;352- if (*fmt == '.') {353- ++fmt; 354- if ('0' <= *fmt && *fmt <= '9')355- precision = skip_atoi(&fmt);356- else if (*fmt == '*') {357- ++fmt;358- /* it's the next argument */359- precision = va_arg(args, int);360- }361- if (precision < 0)362- precision = 0;363- }364-365- /* get the conversion qualifier */366- qualifier = -1;367- if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {368- qualifier = *fmt;369- ++fmt;370- }371-372- /* default base */373- base = 10;374-375- switch (*fmt) {376- case 'c':377- if (!(flags & LEFT))378- while (--field_width > 0)379- *str++ = ' ';380- *str++ = (unsigned char) va_arg(args, int);381- while (--field_width > 0)382- *str++ = ' ';383- continue;384-385- case 's':386- s = va_arg(args, char *);387- if (!s)388- s = "<NULL>";389-390- len = strnlen(s, precision);391-392- if (!(flags & LEFT))393- while (len < field_width--)394- *str++ = ' ';395- for (i = 0; i < len; ++i)396- *str++ = *s++;397- while (len < field_width--)398- *str++ = ' ';399- continue;400-401- case 'p':402- if (field_width == -1) {403- field_width = 2*sizeof(void *);404- flags |= ZEROPAD;405- }406- str = number(str,407- (unsigned long) va_arg(args, void *), 16,408- field_width, precision, flags);409- continue;410-411-412- case 'n':413- if (qualifier == 'l') {414- long * ip = va_arg(args, long *);415- *ip = (str - buf);416- } else if (qualifier == 'Z') {417- size_t * ip = va_arg(args, size_t *);418- *ip = (str - buf);419- } else {420- int * ip = va_arg(args, int *);421- *ip = (str - buf);422- }423- continue;424-425- case '%':426- *str++ = '%';427- continue;428-429- /* integer number formats - set up the flags and "break" */430- case 'o':431- base = 8;432- break;433-434- case 'X':435- flags |= LARGE;436- case 'x':437- base = 16;438- break;439-440- case 'd':441- case 'i':442- flags |= SIGN;443- case 'u':444- break;445-446- default:447- *str++ = '%';448- if (*fmt)449- *str++ = *fmt;450- else451- --fmt;452- continue;453- }454- if (qualifier == 'l') {455- num = va_arg(args, unsigned long);456- if (flags & SIGN)457- num = (signed long) num;458- } else if (qualifier == 'Z') {459- num = va_arg(args, size_t);460- } else if (qualifier == 'h') {461- num = (unsigned short) va_arg(args, int);462- if (flags & SIGN)463- num = (signed short) num;464- } else {465- num = va_arg(args, unsigned int);466- if (flags & SIGN)467- num = (signed int) num;468- }469- str = number(str, num, base, field_width, precision, flags);470- }471- *str = '\0';472- return str-buf;473-}474-475-int sprintf(char * buf, const char *fmt, ...)476-{477- va_list args;478- int i;479-480- va_start(args, fmt);481- i=vsprintf(buf,fmt,args);482- va_end(args);483- return i;484-}485-486-static char sprint_buf[1024];487-488-int489-printf(const char *fmt, ...)490-{491- va_list args;492- int n;493-494- va_start(args, fmt);495- n = vsprintf(sprint_buf, fmt, args);496- va_end(args);497- write(stdout, sprint_buf, n);498- return n;499}
···13#include "prom.h"1415int (*prom)(void *);16+phandle chosen_handle;17+ihandle stdout;1819+int call_prom(const char *service, int nargs, int nret, ...)0000000020{21+ int i;22 struct prom_args {23+ const char *service;24 int nargs;25 int nret;26+ unsigned int args[12];00027 } args;28+ va_list list;2930+ args.service = service;31+ args.nargs = nargs;32+ args.nret = nret;33+34+ va_start(list, nret);35+ for (i = 0; i < nargs; i++)36+ args.args[i] = va_arg(list, unsigned int);37+ va_end(list);38+39+ for (i = 0; i < nret; i++)40+ args.args[nargs+i] = 0;41+42+ if (prom(&args) < 0)43+ return -1;44+45+ return (nret > 0)? args.args[nargs]: 0;46}4748+int call_prom_ret(const char *service, int nargs, int nret,49+ unsigned int *rets, ...)50{51+ int i;52 struct prom_args {53+ const char *service;54 int nargs;55 int nret;56+ unsigned int args[12];00057 } args;58+ va_list list;5960+ args.service = service;61+ args.nargs = nargs;62+ args.nret = nret;63+64+ va_start(list, rets);65+ for (i = 0; i < nargs; i++)66+ args.args[i] = va_arg(list, unsigned int);67+ va_end(list);68+69+ for (i = 0; i < nret; i++)70+ args.args[nargs+i] = 0;71+72+ if (prom(&args) < 0)73+ return -1;74+75+ if (rets != (void *) 0)76+ for (i = 1; i < nret; ++i)77+ rets[i-1] = args.args[nargs+i];78+79+ return (nret > 0)? args.args[nargs]: 0;80}8182+int write(void *handle, void *ptr, int nb)083{84+ return call_prom("write", 3, 1, handle, ptr, nb);000000085}8687+/*88+ * Older OF's require that when claiming a specific range of addresses,89+ * we claim the physical space in the /memory node and the virtual90+ * space in the chosen mmu node, and then do a map operation to91+ * map virtual to physical.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000092 */93+static int need_map = -1;94+static ihandle chosen_mmu;95+static phandle memory;000000009697+/* returns true if s2 is a prefix of s1 */98+static int string_match(const char *s1, const char *s2)99{100+ for (; *s2; ++s2)101+ if (*s1++ != *s2)102+ return 0;103+ return 1;0104}105106+static int check_of_version(void)00000000107{108+ phandle oprom, chosen;109+ char version[64];0110111+ oprom = finddevice("/openprom");112+ if (oprom == (phandle) -1)000113 return 0;114+ if (getprop(oprom, "model", version, sizeof(version)) <= 0)115+ return 0;116+ version[sizeof(version)-1] = 0;117+ printf("OF version = '%s'\r\n", version);118+ if (!string_match(version, "Open Firmware, 1.")119+ && !string_match(version, "FirmWorks,3."))120+ return 0;121+ chosen = finddevice("/chosen");122+ if (chosen == (phandle) -1) {123+ chosen = finddevice("/chosen@0");124+ if (chosen == (phandle) -1) {125+ printf("no chosen\n");126+ return 0;127 }128 }129+ if (getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {130+ printf("no mmu\n");131+ return 0;00132 }133+ memory = (ihandle) call_prom("open", 1, 1, "/memory");134+ if (memory == (ihandle) -1) {135+ memory = (ihandle) call_prom("open", 1, 1, "/memory@0");136+ if (memory == (ihandle) -1) {137+ printf("no memory node\n");138+ return 0;00000000000000139 }140 }141+ printf("old OF detected\r\n");142+ return 1;00000000143}144145+void *claim(unsigned long virt, unsigned long size, unsigned long align)146{147+ int ret;148+ unsigned int result;000149150+ if (need_map < 0)151+ need_map = check_of_version();152+ if (align || !need_map)153+ return (void *) call_prom("claim", 3, 1, virt, size, align);00000154155+ ret = call_prom_ret("call-method", 5, 2, &result, "claim", memory,156+ align, size, virt);157+ if (ret != 0 || result == -1)158+ return (void *) -1;159+ ret = call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu,160+ align, size, virt);161+ /* 0x12 == coherent + read/write */162+ ret = call_prom("call-method", 6, 1, "map", chosen_mmu,163+ 0x12, size, virt, virt);164+ return (void *) virt;000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000165}
+27-11
arch/powerpc/boot/prom.h
···1#ifndef _PPC_BOOT_PROM_H_2#define _PPC_BOOT_PROM_H_34-extern int (*prom) (void *);5-extern void *chosen_handle;67-extern void *stdin;8-extern void *stdout;9-extern void *stderr;00001011extern int write(void *handle, void *ptr, int nb);12-extern int read(void *handle, void *ptr, int nb);13-extern void exit(void);14-extern void pause(void);15-extern void *finddevice(const char *);16-extern void *claim(unsigned long virt, unsigned long size, unsigned long align);17-extern int getprop(void *phandle, const char *name, void *buf, int buflen);00000000000018#endif /* _PPC_BOOT_PROM_H_ */
···1#ifndef _PPC_BOOT_PROM_H_2#define _PPC_BOOT_PROM_H_34+typedef void *phandle;5+typedef void *ihandle;67+extern int (*prom) (void *);8+extern phandle chosen_handle;9+extern ihandle stdout;10+11+int call_prom(const char *service, int nargs, int nret, ...);12+int call_prom_ret(const char *service, int nargs, int nret,13+ unsigned int *rets, ...);1415extern int write(void *handle, void *ptr, int nb);16+extern void *claim(unsigned long virt, unsigned long size, unsigned long aln);17+18+static inline void exit(void)19+{20+ call_prom("exit", 0, 0);21+}22+23+static inline phandle finddevice(const char *name)24+{25+ return (phandle) call_prom("finddevice", 1, 1, name);26+}27+28+static inline int getprop(void *phandle, const char *name,29+ void *buf, int buflen)30+{31+ return call_prom("getprop", 4, 1, phandle, name, buf, buflen);32+}33+34#endif /* _PPC_BOOT_PROM_H_ */
···1+/* IBM RS/6000 "XCOFF" file definitions for BFD.2+ Copyright (C) 1990, 1991 Free Software Foundation, Inc.3+ FIXME: Can someone provide a transliteration of this name into ASCII?4+ Using the following chars caused a compiler warning on HIUX (so I replaced5+ them with octal escapes), and isn't useful without an understanding of what6+ character set it is.7+ Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM8+ and John Gilmore of Cygnus Support. */9+10+/********************** FILE HEADER **********************/11+12+struct external_filehdr {13+ char f_magic[2]; /* magic number */14+ char f_nscns[2]; /* number of sections */15+ char f_timdat[4]; /* time & date stamp */16+ char f_symptr[4]; /* file pointer to symtab */17+ char f_nsyms[4]; /* number of symtab entries */18+ char f_opthdr[2]; /* sizeof(optional hdr) */19+ char f_flags[2]; /* flags */20+};21+22+ /* IBM RS/6000 */23+#define U802WRMAGIC 0730 /* writeable text segments **chh** */24+#define U802ROMAGIC 0735 /* readonly sharable text segments */25+#define U802TOCMAGIC 0737 /* readonly text segments and TOC */26+27+#define BADMAG(x) \28+ ((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \29+ (x).f_magic != U802TOCMAGIC)30+31+#define FILHDR struct external_filehdr32+#define FILHSZ 2033+34+35+/********************** AOUT "OPTIONAL HEADER" **********************/36+37+38+typedef struct39+{40+ unsigned char magic[2]; /* type of file */41+ unsigned char vstamp[2]; /* version stamp */42+ unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */43+ unsigned char dsize[4]; /* initialized data " " */44+ unsigned char bsize[4]; /* uninitialized data " " */45+ unsigned char entry[4]; /* entry pt. */46+ unsigned char text_start[4]; /* base of text used for this file */47+ unsigned char data_start[4]; /* base of data used for this file */48+ unsigned char o_toc[4]; /* address of TOC */49+ unsigned char o_snentry[2]; /* section number of entry point */50+ unsigned char o_sntext[2]; /* section number of .text section */51+ unsigned char o_sndata[2]; /* section number of .data section */52+ unsigned char o_sntoc[2]; /* section number of TOC */53+ unsigned char o_snloader[2]; /* section number of .loader section */54+ unsigned char o_snbss[2]; /* section number of .bss section */55+ unsigned char o_algntext[2]; /* .text alignment */56+ unsigned char o_algndata[2]; /* .data alignment */57+ unsigned char o_modtype[2]; /* module type (??) */58+ unsigned char o_cputype[2]; /* cpu type */59+ unsigned char o_maxstack[4]; /* max stack size (??) */60+ unsigned char o_maxdata[4]; /* max data size (??) */61+ unsigned char o_resv2[12]; /* reserved */62+}63+AOUTHDR;64+65+#define AOUTSZ 7266+#define SMALL_AOUTSZ (28)67+#define AOUTHDRSZ 7268+69+#define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */70+#define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */71+#define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */72+73+74+/********************** SECTION HEADER **********************/75+76+77+struct external_scnhdr {78+ char s_name[8]; /* section name */79+ char s_paddr[4]; /* physical address, aliased s_nlib */80+ char s_vaddr[4]; /* virtual address */81+ char s_size[4]; /* section size */82+ char s_scnptr[4]; /* file ptr to raw data for section */83+ char s_relptr[4]; /* file ptr to relocation */84+ char s_lnnoptr[4]; /* file ptr to line numbers */85+ char s_nreloc[2]; /* number of relocation entries */86+ char s_nlnno[2]; /* number of line number entries*/87+ char s_flags[4]; /* flags */88+};89+90+/*91+ * names of "special" sections92+ */93+#define _TEXT ".text"94+#define _DATA ".data"95+#define _BSS ".bss"96+#define _PAD ".pad"97+#define _LOADER ".loader"98+99+#define SCNHDR struct external_scnhdr100+#define SCNHSZ 40101+102+/* XCOFF uses a special .loader section with type STYP_LOADER. */103+#define STYP_LOADER 0x1000104+105+/* XCOFF uses a special .debug section with type STYP_DEBUG. */106+#define STYP_DEBUG 0x2000107+108+/* XCOFF handles line number or relocation overflow by creating109+ another section header with STYP_OVRFLO set. */110+#define STYP_OVRFLO 0x8000111+112+/********************** LINE NUMBERS **********************/113+114+/* 1 line number entry for every "breakpointable" source line in a section.115+ * Line numbers are grouped on a per function basis; first entry in a function116+ * grouping will have l_lnno = 0 and in place of physical address will be the117+ * symbol table index of the function name.118+ */119+struct external_lineno {120+ union {121+ char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/122+ char l_paddr[4]; /* (physical) address of line number */123+ } l_addr;124+ char l_lnno[2]; /* line number */125+};126+127+128+#define LINENO struct external_lineno129+#define LINESZ 6130+131+132+/********************** SYMBOLS **********************/133+134+#define E_SYMNMLEN 8 /* # characters in a symbol name */135+#define E_FILNMLEN 14 /* # characters in a file name */136+#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */137+138+struct external_syment139+{140+ union {141+ char e_name[E_SYMNMLEN];142+ struct {143+ char e_zeroes[4];144+ char e_offset[4];145+ } e;146+ } e;147+ char e_value[4];148+ char e_scnum[2];149+ char e_type[2];150+ char e_sclass[1];151+ char e_numaux[1];152+};153+154+155+156+#define N_BTMASK (017)157+#define N_TMASK (060)158+#define N_BTSHFT (4)159+#define N_TSHIFT (2)160+161+162+union external_auxent {163+ struct {164+ char x_tagndx[4]; /* str, un, or enum tag indx */165+ union {166+ struct {167+ char x_lnno[2]; /* declaration line number */168+ char x_size[2]; /* str/union/array size */169+ } x_lnsz;170+ char x_fsize[4]; /* size of function */171+ } x_misc;172+ union {173+ struct { /* if ISFCN, tag, or .bb */174+ char x_lnnoptr[4]; /* ptr to fcn line # */175+ char x_endndx[4]; /* entry ndx past block end */176+ } x_fcn;177+ struct { /* if ISARY, up to 4 dimen. */178+ char x_dimen[E_DIMNUM][2];179+ } x_ary;180+ } x_fcnary;181+ char x_tvndx[2]; /* tv index */182+ } x_sym;183+184+ union {185+ char x_fname[E_FILNMLEN];186+ struct {187+ char x_zeroes[4];188+ char x_offset[4];189+ } x_n;190+ } x_file;191+192+ struct {193+ char x_scnlen[4]; /* section length */194+ char x_nreloc[2]; /* # relocation entries */195+ char x_nlinno[2]; /* # line numbers */196+ } x_scn;197+198+ struct {199+ char x_tvfill[4]; /* tv fill value */200+ char x_tvlen[2]; /* length of .tv */201+ char x_tvran[2][2]; /* tv range */202+ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */203+204+ struct {205+ unsigned char x_scnlen[4];206+ unsigned char x_parmhash[4];207+ unsigned char x_snhash[2];208+ unsigned char x_smtyp[1];209+ unsigned char x_smclas[1];210+ unsigned char x_stab[4];211+ unsigned char x_snstab[2];212+ } x_csect;213+214+};215+216+#define SYMENT struct external_syment217+#define SYMESZ 18218+#define AUXENT union external_auxent219+#define AUXESZ 18220+#define DBXMASK 0x80 /* for dbx storage mask */221+#define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK)222+223+224+225+/********************** RELOCATION DIRECTIVES **********************/226+227+228+struct external_reloc {229+ char r_vaddr[4];230+ char r_symndx[4];231+ char r_size[1];232+ char r_type[1];233+};234+235+236+#define RELOC struct external_reloc237+#define RELSZ 10238+239+#define DEFAULT_DATA_SECTION_ALIGNMENT 4240+#define DEFAULT_BSS_SECTION_ALIGNMENT 4241+#define DEFAULT_TEXT_SECTION_ALIGNMENT 4242+/* For new sections we havn't heard of before */243+#define DEFAULT_SECTION_ALIGNMENT 4
···1+#2+# Automatically generated make config: don't edit3+# Linux kernel version: 2.6.15-g461d4edf-dirty4+# Fri Jan 13 11:01:47 20065+#6+# CONFIG_PPC64 is not set7+CONFIG_PPC32=y8+CONFIG_PPC_MERGE=y9+CONFIG_MMU=y10+CONFIG_GENERIC_HARDIRQS=y11+CONFIG_RWSEM_XCHGADD_ALGORITHM=y12+CONFIG_GENERIC_CALIBRATE_DELAY=y13+CONFIG_PPC=y14+CONFIG_EARLY_PRINTK=y15+CONFIG_GENERIC_NVRAM=y16+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y17+CONFIG_ARCH_MAY_HAVE_PC_FDC=y18+CONFIG_PPC_OF=y19+CONFIG_PPC_UDBG_16550=y20+# CONFIG_GENERIC_TBSYNC is not set21+CONFIG_DEFAULT_UIMAGE=y22+23+#24+# Processor support25+#26+# CONFIG_CLASSIC32 is not set27+# CONFIG_PPC_52xx is not set28+# CONFIG_PPC_82xx is not set29+CONFIG_PPC_83xx=y30+# CONFIG_40x is not set31+# CONFIG_44x is not set32+# CONFIG_8xx is not set33+# CONFIG_E200 is not set34+# CONFIG_E500 is not set35+CONFIG_6xx=y36+CONFIG_83xx=y37+CONFIG_PPC_FPU=y38+CONFIG_PPC_STD_MMU=y39+CONFIG_PPC_STD_MMU_32=y40+# CONFIG_SMP is not set41+42+#43+# Code maturity level options44+#45+CONFIG_EXPERIMENTAL=y46+CONFIG_CLEAN_COMPILE=y47+CONFIG_BROKEN_ON_SMP=y48+CONFIG_INIT_ENV_ARG_LIMIT=3249+50+#51+# General setup52+#53+CONFIG_LOCALVERSION=""54+CONFIG_LOCALVERSION_AUTO=y55+CONFIG_SWAP=y56+CONFIG_SYSVIPC=y57+# CONFIG_POSIX_MQUEUE is not set58+# CONFIG_BSD_PROCESS_ACCT is not set59+CONFIG_SYSCTL=y60+# CONFIG_AUDIT is not set61+# CONFIG_IKCONFIG is not set62+CONFIG_INITRAMFS_SOURCE=""63+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set64+CONFIG_EMBEDDED=y65+# CONFIG_KALLSYMS is not set66+CONFIG_HOTPLUG=y67+CONFIG_PRINTK=y68+CONFIG_BUG=y69+CONFIG_ELF_CORE=y70+CONFIG_BASE_FULL=y71+CONFIG_FUTEX=y72+# CONFIG_EPOLL is not set73+CONFIG_SHMEM=y74+CONFIG_CC_ALIGN_FUNCTIONS=075+CONFIG_CC_ALIGN_LABELS=076+CONFIG_CC_ALIGN_LOOPS=077+CONFIG_CC_ALIGN_JUMPS=078+CONFIG_SLAB=y79+# CONFIG_TINY_SHMEM is not set80+CONFIG_BASE_SMALL=081+# CONFIG_SLOB is not set82+83+#84+# Loadable module support85+#86+CONFIG_MODULES=y87+CONFIG_MODULE_UNLOAD=y88+# CONFIG_MODULE_FORCE_UNLOAD is not set89+CONFIG_OBSOLETE_MODPARM=y90+# CONFIG_MODVERSIONS is not set91+# CONFIG_MODULE_SRCVERSION_ALL is not set92+# CONFIG_KMOD is not set93+94+#95+# Block layer96+#97+# CONFIG_LBD is not set98+99+#100+# IO Schedulers101+#102+CONFIG_IOSCHED_NOOP=y103+CONFIG_IOSCHED_AS=y104+CONFIG_IOSCHED_DEADLINE=y105+CONFIG_IOSCHED_CFQ=y106+CONFIG_DEFAULT_AS=y107+# CONFIG_DEFAULT_DEADLINE is not set108+# CONFIG_DEFAULT_CFQ is not set109+# CONFIG_DEFAULT_NOOP is not set110+CONFIG_DEFAULT_IOSCHED="anticipatory"111+CONFIG_PPC_GEN550=y112+# CONFIG_WANT_EARLY_SERIAL is not set113+114+#115+# Platform support116+#117+CONFIG_MPC834x_SYS=y118+CONFIG_MPC834x=y119+120+#121+# Kernel options122+#123+# CONFIG_HIGHMEM is not set124+# CONFIG_HZ_100 is not set125+CONFIG_HZ_250=y126+# CONFIG_HZ_1000 is not set127+CONFIG_HZ=250128+CONFIG_PREEMPT_NONE=y129+# CONFIG_PREEMPT_VOLUNTARY is not set130+# CONFIG_PREEMPT is not set131+CONFIG_BINFMT_ELF=y132+# CONFIG_BINFMT_MISC is not set133+CONFIG_ARCH_FLATMEM_ENABLE=y134+CONFIG_SELECT_MEMORY_MODEL=y135+CONFIG_FLATMEM_MANUAL=y136+# CONFIG_DISCONTIGMEM_MANUAL is not set137+# CONFIG_SPARSEMEM_MANUAL is not set138+CONFIG_FLATMEM=y139+CONFIG_FLAT_NODE_MEM_MAP=y140+# CONFIG_SPARSEMEM_STATIC is not set141+CONFIG_SPLIT_PTLOCK_CPUS=4142+CONFIG_PROC_DEVICETREE=y143+# CONFIG_CMDLINE_BOOL is not set144+# CONFIG_PM is not set145+# CONFIG_SOFTWARE_SUSPEND is not set146+CONFIG_SECCOMP=y147+CONFIG_ISA_DMA_API=y148+149+#150+# Bus options151+#152+CONFIG_GENERIC_ISA_DMA=y153+# CONFIG_PPC_I8259 is not set154+CONFIG_PPC_INDIRECT_PCI=y155+CONFIG_FSL_SOC=y156+CONFIG_PCI=y157+CONFIG_PCI_DOMAINS=y158+# CONFIG_PCI_LEGACY_PROC is not set159+160+#161+# PCCARD (PCMCIA/CardBus) support162+#163+# CONFIG_PCCARD is not set164+165+#166+# PCI Hotplug Support167+#168+# CONFIG_HOTPLUG_PCI is not set169+170+#171+# Advanced setup172+#173+# CONFIG_ADVANCED_OPTIONS is not set174+175+#176+# Default settings for advanced configuration options are used177+#178+CONFIG_HIGHMEM_START=0xfe000000179+CONFIG_LOWMEM_SIZE=0x30000000180+CONFIG_KERNEL_START=0xc0000000181+CONFIG_TASK_SIZE=0x80000000182+CONFIG_BOOT_LOAD=0x00800000183+184+#185+# Networking186+#187+CONFIG_NET=y188+189+#190+# Networking options191+#192+CONFIG_PACKET=y193+# CONFIG_PACKET_MMAP is not set194+CONFIG_UNIX=y195+# CONFIG_NET_KEY is not set196+CONFIG_INET=y197+CONFIG_IP_MULTICAST=y198+# CONFIG_IP_ADVANCED_ROUTER is not set199+CONFIG_IP_FIB_HASH=y200+CONFIG_IP_PNP=y201+CONFIG_IP_PNP_DHCP=y202+CONFIG_IP_PNP_BOOTP=y203+# CONFIG_IP_PNP_RARP is not set204+# CONFIG_NET_IPIP is not set205+# CONFIG_NET_IPGRE is not set206+# CONFIG_IP_MROUTE is not set207+# CONFIG_ARPD is not set208+CONFIG_SYN_COOKIES=y209+# CONFIG_INET_AH is not set210+# CONFIG_INET_ESP is not set211+# CONFIG_INET_IPCOMP is not set212+# CONFIG_INET_TUNNEL is not set213+CONFIG_INET_DIAG=y214+CONFIG_INET_TCP_DIAG=y215+# CONFIG_TCP_CONG_ADVANCED is not set216+CONFIG_TCP_CONG_BIC=y217+# CONFIG_IPV6 is not set218+# CONFIG_NETFILTER is not set219+220+#221+# DCCP Configuration (EXPERIMENTAL)222+#223+# CONFIG_IP_DCCP is not set224+225+#226+# SCTP Configuration (EXPERIMENTAL)227+#228+# CONFIG_IP_SCTP is not set229+# CONFIG_ATM is not set230+# CONFIG_BRIDGE is not set231+# CONFIG_VLAN_8021Q is not set232+# CONFIG_DECNET is not set233+# CONFIG_LLC2 is not set234+# CONFIG_IPX is not set235+# CONFIG_ATALK is not set236+# CONFIG_X25 is not set237+# CONFIG_LAPB is not set238+# CONFIG_NET_DIVERT is not set239+# CONFIG_ECONET is not set240+# CONFIG_WAN_ROUTER is not set241+242+#243+# QoS and/or fair queueing244+#245+# CONFIG_NET_SCHED is not set246+247+#248+# Network testing249+#250+# CONFIG_NET_PKTGEN is not set251+# CONFIG_HAMRADIO is not set252+# CONFIG_IRDA is not set253+# CONFIG_BT is not set254+# CONFIG_IEEE80211 is not set255+256+#257+# Device Drivers258+#259+260+#261+# Generic Driver Options262+#263+CONFIG_STANDALONE=y264+CONFIG_PREVENT_FIRMWARE_BUILD=y265+# CONFIG_FW_LOADER is not set266+267+#268+# Connector - unified userspace <-> kernelspace linker269+#270+# CONFIG_CONNECTOR is not set271+272+#273+# Memory Technology Devices (MTD)274+#275+# CONFIG_MTD is not set276+277+#278+# Parallel port support279+#280+# CONFIG_PARPORT is not set281+282+#283+# Plug and Play support284+#285+286+#287+# Block devices288+#289+# CONFIG_BLK_DEV_FD is not set290+# CONFIG_BLK_CPQ_DA is not set291+# CONFIG_BLK_CPQ_CISS_DA is not set292+# CONFIG_BLK_DEV_DAC960 is not set293+# CONFIG_BLK_DEV_UMEM is not set294+# CONFIG_BLK_DEV_COW_COMMON is not set295+CONFIG_BLK_DEV_LOOP=y296+# CONFIG_BLK_DEV_CRYPTOLOOP is not set297+# CONFIG_BLK_DEV_NBD is not set298+# CONFIG_BLK_DEV_SX8 is not set299+CONFIG_BLK_DEV_RAM=y300+CONFIG_BLK_DEV_RAM_COUNT=16301+CONFIG_BLK_DEV_RAM_SIZE=32768302+CONFIG_BLK_DEV_INITRD=y303+# CONFIG_CDROM_PKTCDVD is not set304+# CONFIG_ATA_OVER_ETH is not set305+306+#307+# ATA/ATAPI/MFM/RLL support308+#309+# CONFIG_IDE is not set310+311+#312+# SCSI device support313+#314+# CONFIG_RAID_ATTRS is not set315+# CONFIG_SCSI is not set316+317+#318+# Multi-device support (RAID and LVM)319+#320+# CONFIG_MD is not set321+322+#323+# Fusion MPT device support324+#325+# CONFIG_FUSION is not set326+327+#328+# IEEE 1394 (FireWire) support329+#330+# CONFIG_IEEE1394 is not set331+332+#333+# I2O device support334+#335+# CONFIG_I2O is not set336+337+#338+# Macintosh device drivers339+#340+# CONFIG_WINDFARM is not set341+342+#343+# Network device support344+#345+CONFIG_NETDEVICES=y346+# CONFIG_DUMMY is not set347+# CONFIG_BONDING is not set348+# CONFIG_EQUALIZER is not set349+# CONFIG_TUN is not set350+351+#352+# ARCnet devices353+#354+# CONFIG_ARCNET is not set355+356+#357+# PHY device support358+#359+CONFIG_PHYLIB=y360+361+#362+# MII PHY device drivers363+#364+CONFIG_MARVELL_PHY=y365+# CONFIG_DAVICOM_PHY is not set366+# CONFIG_QSEMI_PHY is not set367+# CONFIG_LXT_PHY is not set368+# CONFIG_CICADA_PHY is not set369+370+#371+# Ethernet (10 or 100Mbit)372+#373+CONFIG_NET_ETHERNET=y374+CONFIG_MII=y375+# CONFIG_HAPPYMEAL is not set376+# CONFIG_SUNGEM is not set377+# CONFIG_CASSINI is not set378+# CONFIG_NET_VENDOR_3COM is not set379+380+#381+# Tulip family network device support382+#383+# CONFIG_NET_TULIP is not set384+# CONFIG_HP100 is not set385+CONFIG_NET_PCI=y386+# CONFIG_PCNET32 is not set387+# CONFIG_AMD8111_ETH is not set388+# CONFIG_ADAPTEC_STARFIRE is not set389+# CONFIG_B44 is not set390+# CONFIG_FORCEDETH is not set391+# CONFIG_DGRS is not set392+# CONFIG_EEPRO100 is not set393+CONFIG_E100=y394+# CONFIG_FEALNX is not set395+# CONFIG_NATSEMI is not set396+# CONFIG_NE2K_PCI is not set397+# CONFIG_8139CP is not set398+# CONFIG_8139TOO is not set399+# CONFIG_SIS900 is not set400+# CONFIG_EPIC100 is not set401+# CONFIG_SUNDANCE is not set402+# CONFIG_TLAN is not set403+# CONFIG_VIA_RHINE is not set404+405+#406+# Ethernet (1000 Mbit)407+#408+# CONFIG_ACENIC is not set409+# CONFIG_DL2K is not set410+# CONFIG_E1000 is not set411+# CONFIG_NS83820 is not set412+# CONFIG_HAMACHI is not set413+# CONFIG_YELLOWFIN is not set414+# CONFIG_R8169 is not set415+# CONFIG_SIS190 is not set416+# CONFIG_SKGE is not set417+# CONFIG_SKY2 is not set418+# CONFIG_SK98LIN is not set419+# CONFIG_VIA_VELOCITY is not set420+# CONFIG_TIGON3 is not set421+# CONFIG_BNX2 is not set422+CONFIG_GIANFAR=y423+# CONFIG_GFAR_NAPI is not set424+425+#426+# Ethernet (10000 Mbit)427+#428+# CONFIG_CHELSIO_T1 is not set429+# CONFIG_IXGB is not set430+# CONFIG_S2IO is not set431+432+#433+# Token Ring devices434+#435+# CONFIG_TR is not set436+437+#438+# Wireless LAN (non-hamradio)439+#440+# CONFIG_NET_RADIO is not set441+442+#443+# Wan interfaces444+#445+# CONFIG_WAN is not set446+# CONFIG_FDDI is not set447+# CONFIG_HIPPI is not set448+# CONFIG_PPP is not set449+# CONFIG_SLIP is not set450+# CONFIG_SHAPER is not set451+# CONFIG_NETCONSOLE is not set452+# CONFIG_NETPOLL is not set453+# CONFIG_NET_POLL_CONTROLLER is not set454+455+#456+# ISDN subsystem457+#458+# CONFIG_ISDN is not set459+460+#461+# Telephony Support462+#463+# CONFIG_PHONE is not set464+465+#466+# Input device support467+#468+CONFIG_INPUT=y469+470+#471+# Userland interfaces472+#473+# CONFIG_INPUT_MOUSEDEV is not set474+# CONFIG_INPUT_JOYDEV is not set475+# CONFIG_INPUT_TSDEV is not set476+# CONFIG_INPUT_EVDEV is not set477+# CONFIG_INPUT_EVBUG is not set478+479+#480+# Input Device Drivers481+#482+# CONFIG_INPUT_KEYBOARD is not set483+# CONFIG_INPUT_MOUSE is not set484+# CONFIG_INPUT_JOYSTICK is not set485+# CONFIG_INPUT_TOUCHSCREEN is not set486+# CONFIG_INPUT_MISC is not set487+488+#489+# Hardware I/O ports490+#491+# CONFIG_SERIO is not set492+# CONFIG_GAMEPORT is not set493+494+#495+# Character devices496+#497+# CONFIG_VT is not set498+# CONFIG_SERIAL_NONSTANDARD is not set499+500+#501+# Serial drivers502+#503+CONFIG_SERIAL_8250=y504+CONFIG_SERIAL_8250_CONSOLE=y505+CONFIG_SERIAL_8250_NR_UARTS=4506+CONFIG_SERIAL_8250_RUNTIME_UARTS=4507+# CONFIG_SERIAL_8250_EXTENDED is not set508+509+#510+# Non-8250 serial port support511+#512+CONFIG_SERIAL_CORE=y513+CONFIG_SERIAL_CORE_CONSOLE=y514+CONFIG_UNIX98_PTYS=y515+CONFIG_LEGACY_PTYS=y516+CONFIG_LEGACY_PTY_COUNT=256517+518+#519+# IPMI520+#521+# CONFIG_IPMI_HANDLER is not set522+523+#524+# Watchdog Cards525+#526+CONFIG_WATCHDOG=y527+# CONFIG_WATCHDOG_NOWAYOUT is not set528+529+#530+# Watchdog Device Drivers531+#532+# CONFIG_SOFT_WATCHDOG is not set533+CONFIG_83xx_WDT=y534+535+#536+# PCI-based Watchdog Cards537+#538+# CONFIG_PCIPCWATCHDOG is not set539+# CONFIG_WDTPCI is not set540+# CONFIG_NVRAM is not set541+CONFIG_GEN_RTC=y542+# CONFIG_GEN_RTC_X is not set543+# CONFIG_DTLK is not set544+# CONFIG_R3964 is not set545+# CONFIG_APPLICOM is not set546+547+#548+# Ftape, the floppy tape device driver549+#550+# CONFIG_AGP is not set551+# CONFIG_DRM is not set552+# CONFIG_RAW_DRIVER is not set553+554+#555+# TPM devices556+#557+# CONFIG_TCG_TPM is not set558+# CONFIG_TELCLOCK is not set559+560+#561+# I2C support562+#563+CONFIG_I2C=y564+CONFIG_I2C_CHARDEV=y565+566+#567+# I2C Algorithms568+#569+# CONFIG_I2C_ALGOBIT is not set570+# CONFIG_I2C_ALGOPCF is not set571+# CONFIG_I2C_ALGOPCA is not set572+573+#574+# I2C Hardware Bus support575+#576+# CONFIG_I2C_ALI1535 is not set577+# CONFIG_I2C_ALI1563 is not set578+# CONFIG_I2C_ALI15X3 is not set579+# CONFIG_I2C_AMD756 is not set580+# CONFIG_I2C_AMD8111 is not set581+# CONFIG_I2C_I801 is not set582+# CONFIG_I2C_I810 is not set583+# CONFIG_I2C_PIIX4 is not set584+CONFIG_I2C_MPC=y585+# CONFIG_I2C_NFORCE2 is not set586+# CONFIG_I2C_PARPORT_LIGHT is not set587+# CONFIG_I2C_PROSAVAGE is not set588+# CONFIG_I2C_SAVAGE4 is not set589+# CONFIG_SCx200_ACB is not set590+# CONFIG_I2C_SIS5595 is not set591+# CONFIG_I2C_SIS630 is not set592+# CONFIG_I2C_SIS96X is not set593+# CONFIG_I2C_STUB is not set594+# CONFIG_I2C_VIA is not set595+# CONFIG_I2C_VIAPRO is not set596+# CONFIG_I2C_VOODOO3 is not set597+# CONFIG_I2C_PCA_ISA is not set598+599+#600+# Miscellaneous I2C Chip support601+#602+# CONFIG_SENSORS_DS1337 is not set603+# CONFIG_SENSORS_DS1374 is not set604+# CONFIG_SENSORS_EEPROM is not set605+# CONFIG_SENSORS_PCF8574 is not set606+# CONFIG_SENSORS_PCA9539 is not set607+# CONFIG_SENSORS_PCF8591 is not set608+# CONFIG_SENSORS_RTC8564 is not set609+# CONFIG_SENSORS_M41T00 is not set610+# CONFIG_SENSORS_MAX6875 is not set611+# CONFIG_RTC_X1205_I2C is not set612+# CONFIG_I2C_DEBUG_CORE is not set613+# CONFIG_I2C_DEBUG_ALGO is not set614+# CONFIG_I2C_DEBUG_BUS is not set615+# CONFIG_I2C_DEBUG_CHIP is not set616+617+#618+# Dallas's 1-wire bus619+#620+# CONFIG_W1 is not set621+622+#623+# Hardware Monitoring support624+#625+CONFIG_HWMON=y626+# CONFIG_HWMON_VID is not set627+# CONFIG_SENSORS_ADM1021 is not set628+# CONFIG_SENSORS_ADM1025 is not set629+# CONFIG_SENSORS_ADM1026 is not set630+# CONFIG_SENSORS_ADM1031 is not set631+# CONFIG_SENSORS_ADM9240 is not set632+# CONFIG_SENSORS_ASB100 is not set633+# CONFIG_SENSORS_ATXP1 is not set634+# CONFIG_SENSORS_DS1621 is not set635+# CONFIG_SENSORS_FSCHER is not set636+# CONFIG_SENSORS_FSCPOS is not set637+# CONFIG_SENSORS_GL518SM is not set638+# CONFIG_SENSORS_GL520SM is not set639+# CONFIG_SENSORS_IT87 is not set640+# CONFIG_SENSORS_LM63 is not set641+# CONFIG_SENSORS_LM75 is not set642+# CONFIG_SENSORS_LM77 is not set643+# CONFIG_SENSORS_LM78 is not set644+# CONFIG_SENSORS_LM80 is not set645+# CONFIG_SENSORS_LM83 is not set646+# CONFIG_SENSORS_LM85 is not set647+# CONFIG_SENSORS_LM87 is not set648+# CONFIG_SENSORS_LM90 is not set649+# CONFIG_SENSORS_LM92 is not set650+# CONFIG_SENSORS_MAX1619 is not set651+# CONFIG_SENSORS_PC87360 is not set652+# CONFIG_SENSORS_SIS5595 is not set653+# CONFIG_SENSORS_SMSC47M1 is not set654+# CONFIG_SENSORS_SMSC47B397 is not set655+# CONFIG_SENSORS_VIA686A is not set656+# CONFIG_SENSORS_VT8231 is not set657+# CONFIG_SENSORS_W83781D is not set658+# CONFIG_SENSORS_W83792D is not set659+# CONFIG_SENSORS_W83L785TS is not set660+# CONFIG_SENSORS_W83627HF is not set661+# CONFIG_SENSORS_W83627EHF is not set662+# CONFIG_HWMON_DEBUG_CHIP is not set663+664+#665+# Misc devices666+#667+668+#669+# Multimedia Capabilities Port drivers670+#671+672+#673+# Multimedia devices674+#675+# CONFIG_VIDEO_DEV is not set676+677+#678+# Digital Video Broadcasting Devices679+#680+# CONFIG_DVB is not set681+682+#683+# Graphics support684+#685+# CONFIG_FB is not set686+687+#688+# Sound689+#690+# CONFIG_SOUND is not set691+692+#693+# USB support694+#695+CONFIG_USB_ARCH_HAS_HCD=y696+CONFIG_USB_ARCH_HAS_OHCI=y697+# CONFIG_USB is not set698+699+#700+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'701+#702+703+#704+# USB Gadget Support705+#706+# CONFIG_USB_GADGET is not set707+708+#709+# MMC/SD Card support710+#711+# CONFIG_MMC is not set712+713+#714+# InfiniBand support715+#716+# CONFIG_INFINIBAND is not set717+718+#719+# SN Devices720+#721+722+#723+# File systems724+#725+CONFIG_EXT2_FS=y726+# CONFIG_EXT2_FS_XATTR is not set727+# CONFIG_EXT2_FS_XIP is not set728+CONFIG_EXT3_FS=y729+CONFIG_EXT3_FS_XATTR=y730+# CONFIG_EXT3_FS_POSIX_ACL is not set731+# CONFIG_EXT3_FS_SECURITY is not set732+CONFIG_JBD=y733+# CONFIG_JBD_DEBUG is not set734+CONFIG_FS_MBCACHE=y735+# CONFIG_REISERFS_FS is not set736+# CONFIG_JFS_FS is not set737+# CONFIG_FS_POSIX_ACL is not set738+# CONFIG_XFS_FS is not set739+# CONFIG_OCFS2_FS is not set740+# CONFIG_MINIX_FS is not set741+# CONFIG_ROMFS_FS is not set742+CONFIG_INOTIFY=y743+# CONFIG_QUOTA is not set744+CONFIG_DNOTIFY=y745+# CONFIG_AUTOFS_FS is not set746+# CONFIG_AUTOFS4_FS is not set747+# CONFIG_FUSE_FS is not set748+749+#750+# CD-ROM/DVD Filesystems751+#752+# CONFIG_ISO9660_FS is not set753+# CONFIG_UDF_FS is not set754+755+#756+# DOS/FAT/NT Filesystems757+#758+# CONFIG_MSDOS_FS is not set759+# CONFIG_VFAT_FS is not set760+# CONFIG_NTFS_FS is not set761+762+#763+# Pseudo filesystems764+#765+CONFIG_PROC_FS=y766+CONFIG_PROC_KCORE=y767+CONFIG_SYSFS=y768+CONFIG_TMPFS=y769+# CONFIG_HUGETLB_PAGE is not set770+CONFIG_RAMFS=y771+# CONFIG_RELAYFS_FS is not set772+# CONFIG_CONFIGFS_FS is not set773+774+#775+# Miscellaneous filesystems776+#777+# CONFIG_ADFS_FS is not set778+# CONFIG_AFFS_FS is not set779+# CONFIG_HFS_FS is not set780+# CONFIG_HFSPLUS_FS is not set781+# CONFIG_BEFS_FS is not set782+# CONFIG_BFS_FS is not set783+# CONFIG_EFS_FS is not set784+# CONFIG_CRAMFS is not set785+# CONFIG_VXFS_FS is not set786+# CONFIG_HPFS_FS is not set787+# CONFIG_QNX4FS_FS is not set788+# CONFIG_SYSV_FS is not set789+# CONFIG_UFS_FS is not set790+791+#792+# Network File Systems793+#794+CONFIG_NFS_FS=y795+CONFIG_NFS_V3=y796+# CONFIG_NFS_V3_ACL is not set797+CONFIG_NFS_V4=y798+# CONFIG_NFS_DIRECTIO is not set799+# CONFIG_NFSD is not set800+CONFIG_ROOT_NFS=y801+CONFIG_LOCKD=y802+CONFIG_LOCKD_V4=y803+CONFIG_NFS_COMMON=y804+CONFIG_SUNRPC=y805+CONFIG_SUNRPC_GSS=y806+CONFIG_RPCSEC_GSS_KRB5=y807+# CONFIG_RPCSEC_GSS_SPKM3 is not set808+# CONFIG_SMB_FS is not set809+# CONFIG_CIFS is not set810+# CONFIG_NCP_FS is not set811+# CONFIG_CODA_FS is not set812+# CONFIG_AFS_FS is not set813+# CONFIG_9P_FS is not set814+815+#816+# Partition Types817+#818+CONFIG_PARTITION_ADVANCED=y819+# CONFIG_ACORN_PARTITION is not set820+# CONFIG_OSF_PARTITION is not set821+# CONFIG_AMIGA_PARTITION is not set822+# CONFIG_ATARI_PARTITION is not set823+# CONFIG_MAC_PARTITION is not set824+# CONFIG_MSDOS_PARTITION is not set825+# CONFIG_LDM_PARTITION is not set826+# CONFIG_SGI_PARTITION is not set827+# CONFIG_ULTRIX_PARTITION is not set828+# CONFIG_SUN_PARTITION is not set829+# CONFIG_EFI_PARTITION is not set830+831+#832+# Native Language Support833+#834+# CONFIG_NLS is not set835+836+#837+# Library routines838+#839+# CONFIG_CRC_CCITT is not set840+# CONFIG_CRC16 is not set841+CONFIG_CRC32=y842+# CONFIG_LIBCRC32C is not set843+844+#845+# Instrumentation Support846+#847+# CONFIG_PROFILING is not set848+849+#850+# Kernel hacking851+#852+# CONFIG_PRINTK_TIME is not set853+# CONFIG_MAGIC_SYSRQ is not set854+# CONFIG_DEBUG_KERNEL is not set855+CONFIG_LOG_BUF_SHIFT=14856+# CONFIG_BOOTX_TEXT is not set857+# CONFIG_SERIAL_TEXT_DEBUG is not set858+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set859+# CONFIG_PPC_EARLY_DEBUG_G5 is not set860+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set861+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set862+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set863+864+#865+# Security options866+#867+# CONFIG_KEYS is not set868+# CONFIG_SECURITY is not set869+870+#871+# Cryptographic options872+#873+CONFIG_CRYPTO=y874+# CONFIG_CRYPTO_HMAC is not set875+# CONFIG_CRYPTO_NULL is not set876+# CONFIG_CRYPTO_MD4 is not set877+CONFIG_CRYPTO_MD5=y878+# CONFIG_CRYPTO_SHA1 is not set879+# CONFIG_CRYPTO_SHA256 is not set880+# CONFIG_CRYPTO_SHA512 is not set881+# CONFIG_CRYPTO_WP512 is not set882+# CONFIG_CRYPTO_TGR192 is not set883+CONFIG_CRYPTO_DES=y884+# CONFIG_CRYPTO_BLOWFISH is not set885+# CONFIG_CRYPTO_TWOFISH is not set886+# CONFIG_CRYPTO_SERPENT is not set887+# CONFIG_CRYPTO_AES is not set888+# CONFIG_CRYPTO_CAST5 is not set889+# CONFIG_CRYPTO_CAST6 is not set890+# CONFIG_CRYPTO_TEA is not set891+# CONFIG_CRYPTO_ARC4 is not set892+# CONFIG_CRYPTO_KHAZAD is not set893+# CONFIG_CRYPTO_ANUBIS is not set894+# CONFIG_CRYPTO_DEFLATE is not set895+# CONFIG_CRYPTO_MICHAEL_MIC is not set896+# CONFIG_CRYPTO_CRC32C is not set897+# CONFIG_CRYPTO_TEST is not set898+899+#900+# Hardware crypto devices901+#902+903+#904+# SEC2.x Options905+#906+CONFIG_MPC8349E_SEC2x=y907+908+#909+# SEC2.x Test Options910+#911+CONFIG_MPC8349E_SEC2xTEST=y
···130 mfcr r7131132 /* Get storage ptr */133- LOADADDR(r5,cpu_state_storage)134135 /* We only deal with 970 for now */136 mfspr r0,SPRN_PVR···164 /* Get storage ptr (FIXME when using anton reloc as we165 * are running with translation disabled here166 */167- LOADADDR(r5,cpu_state_storage)168169 /* We only deal with 970 for now */170 mfspr r0,SPRN_PVR
···130 mfcr r7131132 /* Get storage ptr */133+ LOAD_REG_IMMEDIATE(r5,cpu_state_storage)134135 /* We only deal with 970 for now */136 mfspr r0,SPRN_PVR···164 /* Get storage ptr (FIXME when using anton reloc as we165 * are running with translation disabled here166 */167+ LOAD_REG_IMMEDIATE(r5,cpu_state_storage)168169 /* We only deal with 970 for now */170 mfspr r0,SPRN_PVR
···511 cmpdi 0,r5,0512 beq 4f513 /* Check for pending interrupts (iSeries) */514- ld r3,PACALPPACA+LPPACAANYINT(r13)0515 cmpdi r3,0516 beq+ 4f /* skip do_IRQ if no interrupts */517···690 std r6,PACASAVEDMSR(r13)691692 /* Setup our real return addr */ 693- SET_REG_TO_LABEL(r4,.rtas_return_loc)694- SET_REG_TO_CONST(r9,PAGE_OFFSET)695- sub r4,r4,r9696 mtlr r4697698 li r0,0···706 sync /* disable interrupts so SRR0/1 */707 mtmsrd r0 /* don't get trashed */708709- SET_REG_TO_LABEL(r4,rtas)710 ld r5,RTASENTRY(r4) /* get the rtas->entry value */711 ld r4,RTASBASE(r4) /* get the rtas->base value */712···718_STATIC(rtas_return_loc)719 /* relocation is off at this point */720 mfspr r4,SPRN_SPRG3 /* Get PACA */721- SET_REG_TO_CONST(r5, PAGE_OFFSET)722- sub r4,r4,r5 /* RELOC the PACA base pointer */723724 mfmsr r6725 li r0,MSR_RI···727 mtmsrd r6728729 ld r1,PACAR1(r4) /* Restore our SP */730- LOADADDR(r3,.rtas_restore_regs)731 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */732733 mtspr SPRN_SRR0,r3
···511 cmpdi 0,r5,0512 beq 4f513 /* Check for pending interrupts (iSeries) */514+ ld r3,PACALPPACAPTR(r13)515+ ld r3,LPPACAANYINT(r3)516 cmpdi r3,0517 beq+ 4f /* skip do_IRQ if no interrupts */518···689 std r6,PACASAVEDMSR(r13)690691 /* Setup our real return addr */ 692+ LOAD_REG_ADDR(r4,.rtas_return_loc)693+ clrldi r4,r4,2 /* convert to realmode address */0694 mtlr r4695696 li r0,0···706 sync /* disable interrupts so SRR0/1 */707 mtmsrd r0 /* don't get trashed */708709+ LOAD_REG_ADDR(r4, rtas)710 ld r5,RTASENTRY(r4) /* get the rtas->entry value */711 ld r4,RTASBASE(r4) /* get the rtas->base value */712···718_STATIC(rtas_return_loc)719 /* relocation is off at this point */720 mfspr r4,SPRN_SPRG3 /* Get PACA */721+ clrldi r4,r4,2 /* convert to realmode address */0722723 mfmsr r6724 li r0,MSR_RI···728 mtmsrd r6729730 ld r1,PACAR1(r4) /* Restore our SP */731+ LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs)732 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */733734 mtspr SPRN_SRR0,r3
+5-5
arch/powerpc/kernel/fpu.S
···39 * to another. Instead we call giveup_fpu in switch_to.40 */41#ifndef CONFIG_SMP42- LOADBASE(r3, last_task_used_math)43 toreal(r3)44- PPC_LL r4,OFF(last_task_used_math)(r3)45 PPC_LCMPI 0,r4,046 beq 1f47 toreal(r4)···77#ifndef CONFIG_SMP78 subi r4,r5,THREAD79 fromreal(r4)80- PPC_STL r4,OFF(last_task_used_math)(r3)81#endif /* CONFIG_SMP */82 /* restore registers and return */83 /* we haven't used ctr or xer or lr */···1131:114#ifndef CONFIG_SMP115 li r5,0116- LOADBASE(r4,last_task_used_math)117- PPC_STL r5,OFF(last_task_used_math)(r4)118#endif /* CONFIG_SMP */119 blr120
···39 * to another. Instead we call giveup_fpu in switch_to.40 */41#ifndef CONFIG_SMP42+ LOAD_REG_ADDRBASE(r3, last_task_used_math)43 toreal(r3)44+ PPC_LL r4,ADDROFF(last_task_used_math)(r3)45 PPC_LCMPI 0,r4,046 beq 1f47 toreal(r4)···77#ifndef CONFIG_SMP78 subi r4,r5,THREAD79 fromreal(r4)80+ PPC_STL r4,ADDROFF(last_task_used_math)(r3)81#endif /* CONFIG_SMP */82 /* restore registers and return */83 /* we haven't used ctr or xer or lr */···1131:114#ifndef CONFIG_SMP115 li r5,0116+ LOAD_REG_ADDRBASE(r4,last_task_used_math)117+ PPC_STL r5,ADDROFF(last_task_used_math)(r4)118#endif /* CONFIG_SMP */119 blr120
+60-52
arch/powerpc/kernel/head_64.S
···154 bne 100b155156#ifdef CONFIG_HMT157- LOADADDR(r4, .hmt_init)158 mtctr r4159 bctr160#else161#ifdef CONFIG_SMP162- LOADADDR(r4, .pSeries_secondary_smp_init)163 mtctr r4164 mr r3,r24165 bctr···205#define EX_LR 72206207/*208- * We're short on space and time in the exception prolog, so we can't use209- * the normal LOADADDR macro. Normally we just need the low halfword of the210- * address, but for Kdump we need the whole low word.0211 */212#ifdef CONFIG_CRASH_DUMP213#define LOAD_HANDLER(reg, label) \···255256#define EXCEPTION_PROLOG_ISERIES_2 \257 mfmsr r10; \258- ld r11,PACALPPACA+LPPACASRR0(r13); \259- ld r12,PACALPPACA+LPPACASRR1(r13); \0260 ori r10,r10,MSR_RI; \261 mtmsrd r10,1262···636 std r12,PACA_EXSLB+EX_R12(r13)637 mfspr r10,SPRN_SPRG1638 std r10,PACA_EXSLB+EX_R13(r13)639- ld r12,PACALPPACA+LPPACASRR1(r13);0640 b .slb_miss_realmode641642 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)···647 mtspr SPRN_SPRG1,r13 /* save r13 */648 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */649 std r3,PACA_EXSLB+EX_R3(r13)650- ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */0651 std r9,PACA_EXSLB+EX_R9(r13)652 mfcr r9653#ifdef __DISABLED__···660 std r12,PACA_EXSLB+EX_R12(r13)661 mfspr r10,SPRN_SPRG1662 std r10,PACA_EXSLB+EX_R13(r13)663- ld r12,PACALPPACA+LPPACASRR1(r13);0664 b .slb_miss_realmode665666#ifdef __DISABLED__···718 lbz r23,PACAPROCSTART(r13) /* Test if this processor719 * should start */720 sync721- LOADADDR(r3,current_set)722 sldi r28,r24,3 /* get current_set[cpu#] */723 ldx r3,r3,r28724 addi r1,r3,THREAD_SIZE···750 .globl decrementer_iSeries_masked751decrementer_iSeries_masked:752 li r11,1753- stb r11,PACALPPACA+LPPACADECRINT(r13)754- LOADBASE(r12,tb_ticks_per_jiffy)755- lwz r12,OFF(tb_ticks_per_jiffy)(r12)0756 mtspr SPRN_DEC,r12757 /* fall through */758759 .globl hardware_interrupt_iSeries_masked760hardware_interrupt_iSeries_masked:761 mtcrf 0x80,r9 /* Restore regs */762- ld r11,PACALPPACA+LPPACASRR0(r13)763- ld r12,PACALPPACA+LPPACASRR1(r13)0764 mtspr SPRN_SRR0,r11765 mtspr SPRN_SRR1,r12766 ld r9,PACA_EXGEN+EX_R9(r13)···1001 ld r3,PACA_EXSLB+EX_R3(r13)1002 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */1003#ifdef CONFIG_PPC_ISERIES1004- ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */01005#endif /* CONFIG_PPC_ISERIES */10061007 mtlr r10···1420 * physical cpu id in r24, we need to search the pacas to find1421 * which logical id maps to our physical one.1422 */1423- LOADADDR(r13, paca) /* Get base vaddr of paca array */1424 li r5,0 /* logical cpu id */14251: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */1426 cmpw r6,r24 /* Compare to our id */···1454#ifdef CONFIG_PPC_ISERIES1455_STATIC(__start_initialization_iSeries)1456 /* Clear out the BSS */1457- LOADADDR(r11,__bss_stop)1458- LOADADDR(r8,__bss_start)1459 sub r11,r11,r8 /* bss size */1460 addi r11,r11,7 /* round up to an even double word */1461 rldicl. r11,r11,61,3 /* shift right by 3 */···14663: stdu r0,8(r8)1467 bdnz 3b14684:1469- LOADADDR(r1,init_thread_union)1470 addi r1,r1,THREAD_SIZE1471 li r0,01472 stdu r0,-STACK_FRAME_OVERHEAD(r1)14731474- LOADADDR(r3,cpu_specs)1475- LOADADDR(r4,cur_cpu_spec)1476 li r5,01477 bl .identify_cpu14781479- LOADADDR(r2,__toc_start)1480 addi r2,r2,0x40001481 addi r2,r2,0x40001482···1536 li r24,015371538 /* Switch off MMU if not already */1539- LOADADDR(r4, .__after_prom_start - KERNELBASE)1540 add r4,r4,r301541 bl .__mmu_off1542 b .__after_prom_start···1556 /* put a relocation offset into r3 */1557 bl .reloc_offset15581559- LOADADDR(r2,__toc_start)1560 addi r2,r2,0x40001561 addi r2,r2,0x40001562···1596 */1597 bl .reloc_offset1598 mr r26,r31599- SET_REG_TO_CONST(r27,KERNELBASE)16001601- LOADADDR(r3, PHYSICAL_START) /* target addr */16021603 // XXX FIXME: Use phys returned by OF (r30)1604 add r4,r27,r26 /* source addr */···1606 /* i.e. where we are running */1607 /* the source addr */16081609- LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */1610 sub r5,r5,r2716111612 li r6,0x100 /* Start offset, the first 0x100 */···1616 /* this includes the code being */1617 /* executed here. */16181619- LOADADDR(r0, 4f) /* Jump to the copy of this code */1620 mtctr r0 /* that we just made/relocated */1621 bctr16221623-4: LOADADDR(r5,klimit)1624 add r5,r5,r261625 ld r5,0(r5) /* get the value of klimit */1626 sub r5,r5,r27···1702 mtmsrd r3 /* RI on */17031704 /* Set up a paca value for this processor. */1705- LOADADDR(r4, paca) /* Get base vaddr of paca array */1706 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */1707 add r13,r13,r4 /* for this processor. */1708 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */···1739 bl .early_setup_secondary17401741 /* Initialize the kernel stack. Just a repeat for iSeries. */1742- LOADADDR(r3,current_set)1743 sldi r28,r24,3 /* get current_set[cpu#] */1744 ldx r1,r3,r281745 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD···1750 mtlr r717511752 /* enable MMU and jump to start_secondary */1753- LOADADDR(r3,.start_secondary_prolog)1754- SET_REG_TO_CONST(r4, MSR_KERNEL)1755#ifdef DO_SOFT_DISABLE1756 ori r4,r4,MSR_EE1757#endif···1800 * be detached from the kernel completely. Besides, we need1801 * to clear it now for kexec-style entry.1802 */1803- LOADADDR(r11,__bss_stop)1804- LOADADDR(r8,__bss_start)1805 sub r11,r11,r8 /* bss size */1806 addi r11,r11,7 /* round up to an even double word */1807 rldicl. r11,r11,61,3 /* shift right by 3 */···1839 /* up the htab. This is done because we have relocated the */1840 /* kernel but are still running in real mode. */18411842- LOADADDR(r3,init_thread_union)1843 add r3,r3,r2618441845 /* set up a stack pointer (physical address) */···1848 stdu r0,-STACK_FRAME_OVERHEAD(r1)18491850 /* set up the TOC (physical address) */1851- LOADADDR(r2,__toc_start)1852 addi r2,r2,0x40001853 addi r2,r2,0x40001854 add r2,r2,r2618551856- LOADADDR(r3,cpu_specs)1857 add r3,r3,r261858- LOADADDR(r4,cur_cpu_spec)1859 add r4,r4,r261860 mr r5,r261861 bl .identify_cpu···1871 * nowhere it can be initialized differently before we reach this1872 * code1873 */1874- LOADADDR(r27, boot_cpuid)1875 add r27,r27,r261876 lwz r27,0(r27)18771878- LOADADDR(r24, paca) /* Get base vaddr of paca array */1879 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */1880 add r13,r13,r24 /* for this processor. */1881 add r13,r13,r26 /* convert to physical addr */···1888 mr r3,r311889 bl .early_setup18901891- LOADADDR(r3,.start_here_common)1892- SET_REG_TO_CONST(r4, MSR_KERNEL)1893 mtspr SPRN_SRR0,r31894 mtspr SPRN_SRR1,r41895 rfid···1903 /* The following code sets up the SP and TOC now that we are */1904 /* running with translation enabled. */19051906- LOADADDR(r3,init_thread_union)19071908 /* set up the stack */1909 addi r1,r3,THREAD_SIZE···1916 li r3,01917 bl .do_cpu_ftr_fixups19181919- LOADADDR(r26, boot_cpuid)1920 lwz r26,0(r26)19211922- LOADADDR(r24, paca) /* Get base vaddr of paca array */1923 mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */1924 add r13,r13,r24 /* for this processor. */1925 mtspr SPRN_SPRG3,r1319261927 /* ptr to current */1928- LOADADDR(r4,init_task)1929 std r4,PACACURRENT(r13)19301931 /* Load the TOC */···19481949_GLOBAL(hmt_init)1950#ifdef CONFIG_HMT1951- LOADADDR(r5, hmt_thread_data)1952 mfspr r7,SPRN_PVR1953 srwi r7,r7,161954 cmpwi r7,0x34 /* Pulsar */···1969 b 101f19701971__hmt_secondary_hold:1972- LOADADDR(r5, hmt_thread_data)1973 clrldi r5,r5,41974 li r7,01975 mfspr r6,SPRN_PIR···19971998#ifdef CONFIG_HMT1999_GLOBAL(hmt_start_secondary)2000- LOADADDR(r4,__hmt_secondary_hold)2001 clrldi r4,r4,42002 mtspr SPRN_NIADORM, r42003 mfspr r4, SPRN_MSRDORM
···154 bne 100b155156#ifdef CONFIG_HMT157+ SET_REG_IMMEDIATE(r4, .hmt_init)158 mtctr r4159 bctr160#else161#ifdef CONFIG_SMP162+ LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init)163 mtctr r4164 mr r3,r24165 bctr···205#define EX_LR 72206207/*208+ * We're short on space and time in the exception prolog, so we can't209+ * use the normal SET_REG_IMMEDIATE macro. Normally we just need the210+ * low halfword of the address, but for Kdump we need the whole low211+ * word.212 */213#ifdef CONFIG_CRASH_DUMP214#define LOAD_HANDLER(reg, label) \···254255#define EXCEPTION_PROLOG_ISERIES_2 \256 mfmsr r10; \257+ ld r12,PACALPPACAPTR(r13); \258+ ld r11,LPPACASRR0(r12); \259+ ld r12,LPPACASRR1(r12); \260 ori r10,r10,MSR_RI; \261 mtmsrd r10,1262···634 std r12,PACA_EXSLB+EX_R12(r13)635 mfspr r10,SPRN_SPRG1636 std r10,PACA_EXSLB+EX_R13(r13)637+ ld r12,PACALPPACAPTR(r13)638+ ld r12,LPPACASRR1(r12)639 b .slb_miss_realmode640641 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)···644 mtspr SPRN_SPRG1,r13 /* save r13 */645 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */646 std r3,PACA_EXSLB+EX_R3(r13)647+ ld r3,PACALPPACAPTR(r13)648+ ld r3,LPPACASRR0(r3) /* get SRR0 value */649 std r9,PACA_EXSLB+EX_R9(r13)650 mfcr r9651#ifdef __DISABLED__···656 std r12,PACA_EXSLB+EX_R12(r13)657 mfspr r10,SPRN_SPRG1658 std r10,PACA_EXSLB+EX_R13(r13)659+ ld r12,PACALPPACAPTR(r13)660+ ld r12,LPPACASRR1(r12)661 b .slb_miss_realmode662663#ifdef __DISABLED__···713 lbz r23,PACAPROCSTART(r13) /* Test if this processor714 * should start */715 sync716+ LOAD_REG_IMMEDIATE(r3,current_set)717 sldi r28,r24,3 /* get current_set[cpu#] */718 ldx r3,r3,r28719 addi r1,r3,THREAD_SIZE···745 .globl decrementer_iSeries_masked746decrementer_iSeries_masked:747 li r11,1748+ ld r12,PACALPPACAPTR(r13)749+ stb r11,LPPACADECRINT(r12)750+ LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy)751+ lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12)752 mtspr SPRN_DEC,r12753 /* fall through */754755 .globl hardware_interrupt_iSeries_masked756hardware_interrupt_iSeries_masked:757 mtcrf 0x80,r9 /* Restore regs */758+ ld r12,PACALPPACAPTR(r13)759+ ld r11,LPPACASRR0(r12)760+ ld r12,LPPACASRR1(r12)761 mtspr SPRN_SRR0,r11762 mtspr SPRN_SRR1,r12763 ld r9,PACA_EXGEN+EX_R9(r13)···994 ld r3,PACA_EXSLB+EX_R3(r13)995 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */996#ifdef CONFIG_PPC_ISERIES997+ ld r11,PACALPPACAPTR(r13)998+ ld r11,LPPACASRR0(r11) /* get SRR0 value */999#endif /* CONFIG_PPC_ISERIES */10001001 mtlr r10···1412 * physical cpu id in r24, we need to search the pacas to find1413 * which logical id maps to our physical one.1414 */1415+ LOAD_REG_IMMEDIATE(r13, paca) /* Get base vaddr of paca array */1416 li r5,0 /* logical cpu id */14171: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */1418 cmpw r6,r24 /* Compare to our id */···1446#ifdef CONFIG_PPC_ISERIES1447_STATIC(__start_initialization_iSeries)1448 /* Clear out the BSS */1449+ LOAD_REG_IMMEDIATE(r11,__bss_stop)1450+ LOAD_REG_IMMEDIATE(r8,__bss_start)1451 sub r11,r11,r8 /* bss size */1452 addi r11,r11,7 /* round up to an even double word */1453 rldicl. r11,r11,61,3 /* shift right by 3 */···14583: stdu r0,8(r8)1459 bdnz 3b14604:1461+ LOAD_REG_IMMEDIATE(r1,init_thread_union)1462 addi r1,r1,THREAD_SIZE1463 li r0,01464 stdu r0,-STACK_FRAME_OVERHEAD(r1)14651466+ LOAD_REG_IMMEDIATE(r3,cpu_specs)1467+ LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)1468 li r5,01469 bl .identify_cpu14701471+ LOAD_REG_IMMEDIATE(r2,__toc_start)1472 addi r2,r2,0x40001473 addi r2,r2,0x40001474···1528 li r24,015291530 /* Switch off MMU if not already */1531+ LOAD_REG_IMMEDIATE(r4, .__after_prom_start - KERNELBASE)1532 add r4,r4,r301533 bl .__mmu_off1534 b .__after_prom_start···1548 /* put a relocation offset into r3 */1549 bl .reloc_offset15501551+ LOAD_REG_IMMEDIATE(r2,__toc_start)1552 addi r2,r2,0x40001553 addi r2,r2,0x40001554···1588 */1589 bl .reloc_offset1590 mr r26,r31591+ LOAD_REG_IMMEDIATE(r27, KERNELBASE)15921593+ LOAD_REG_IMMEDIATE(r3, PHYSICAL_START) /* target addr */15941595 // XXX FIXME: Use phys returned by OF (r30)1596 add r4,r27,r26 /* source addr */···1598 /* i.e. where we are running */1599 /* the source addr */16001601+ LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */1602 sub r5,r5,r2716031604 li r6,0x100 /* Start offset, the first 0x100 */···1608 /* this includes the code being */1609 /* executed here. */16101611+ LOAD_REG_IMMEDIATE(r0, 4f) /* Jump to the copy of this code */1612 mtctr r0 /* that we just made/relocated */1613 bctr16141615+4: LOAD_REG_IMMEDIATE(r5,klimit)1616 add r5,r5,r261617 ld r5,0(r5) /* get the value of klimit */1618 sub r5,r5,r27···1694 mtmsrd r3 /* RI on */16951696 /* Set up a paca value for this processor. */1697+ LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */1698 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */1699 add r13,r13,r4 /* for this processor. */1700 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */···1731 bl .early_setup_secondary17321733 /* Initialize the kernel stack. Just a repeat for iSeries. */1734+ LOAD_REG_ADDR(r3, current_set)1735 sldi r28,r24,3 /* get current_set[cpu#] */1736 ldx r1,r3,r281737 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD···1742 mtlr r717431744 /* enable MMU and jump to start_secondary */1745+ LOAD_REG_ADDR(r3, .start_secondary_prolog)1746+ LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)1747#ifdef DO_SOFT_DISABLE1748 ori r4,r4,MSR_EE1749#endif···1792 * be detached from the kernel completely. Besides, we need1793 * to clear it now for kexec-style entry.1794 */1795+ LOAD_REG_IMMEDIATE(r11,__bss_stop)1796+ LOAD_REG_IMMEDIATE(r8,__bss_start)1797 sub r11,r11,r8 /* bss size */1798 addi r11,r11,7 /* round up to an even double word */1799 rldicl. r11,r11,61,3 /* shift right by 3 */···1831 /* up the htab. This is done because we have relocated the */1832 /* kernel but are still running in real mode. */18331834+ LOAD_REG_IMMEDIATE(r3,init_thread_union)1835 add r3,r3,r2618361837 /* set up a stack pointer (physical address) */···1840 stdu r0,-STACK_FRAME_OVERHEAD(r1)18411842 /* set up the TOC (physical address) */1843+ LOAD_REG_IMMEDIATE(r2,__toc_start)1844 addi r2,r2,0x40001845 addi r2,r2,0x40001846 add r2,r2,r2618471848+ LOAD_REG_IMMEDIATE(r3, cpu_specs)1849 add r3,r3,r261850+ LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)1851 add r4,r4,r261852 mr r5,r261853 bl .identify_cpu···1863 * nowhere it can be initialized differently before we reach this1864 * code1865 */1866+ LOAD_REG_IMMEDIATE(r27, boot_cpuid)1867 add r27,r27,r261868 lwz r27,0(r27)18691870+ LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */1871 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */1872 add r13,r13,r24 /* for this processor. */1873 add r13,r13,r26 /* convert to physical addr */···1880 mr r3,r311881 bl .early_setup18821883+ LOAD_REG_IMMEDIATE(r3, .start_here_common)1884+ LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)1885 mtspr SPRN_SRR0,r31886 mtspr SPRN_SRR1,r41887 rfid···1895 /* The following code sets up the SP and TOC now that we are */1896 /* running with translation enabled. */18971898+ LOAD_REG_IMMEDIATE(r3,init_thread_union)18991900 /* set up the stack */1901 addi r1,r3,THREAD_SIZE···1908 li r3,01909 bl .do_cpu_ftr_fixups19101911+ LOAD_REG_IMMEDIATE(r26, boot_cpuid)1912 lwz r26,0(r26)19131914+ LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */1915 mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */1916 add r13,r13,r24 /* for this processor. */1917 mtspr SPRN_SPRG3,r1319181919 /* ptr to current */1920+ LOAD_REG_IMMEDIATE(r4, init_task)1921 std r4,PACACURRENT(r13)19221923 /* Load the TOC */···19401941_GLOBAL(hmt_init)1942#ifdef CONFIG_HMT1943+ LOAD_REG_IMMEDIATE(r5, hmt_thread_data)1944 mfspr r7,SPRN_PVR1945 srwi r7,r7,161946 cmpwi r7,0x34 /* Pulsar */···1961 b 101f19621963__hmt_secondary_hold:1964+ LOAD_REG_IMMEDIATE(r5, hmt_thread_data)1965 clrldi r5,r5,41966 li r7,01967 mfspr r6,SPRN_PIR···19891990#ifdef CONFIG_HMT1991_GLOBAL(hmt_start_secondary)1992+ LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold)1993 clrldi r4,r4,41994 mtspr SPRN_NIADORM, r41995 mfspr r4, SPRN_MSRDORM
+4-4
arch/powerpc/kernel/idle_power4.S
···38 /* We must dynamically check for the NAP feature as it39 * can be cleared by CPU init after the fixups are done40 */41- LOADBASE(r3,cur_cpu_spec)42- ld r4,OFF(cur_cpu_spec)(r3)43 ld r4,CPU_SPEC_FEATURES(r4)44 andi. r0,r4,CPU_FTR_CAN_NAP45 beqlr46 /* Now check if user or arch enabled NAP mode */47- LOADBASE(r3,powersave_nap)48- lwz r4,OFF(powersave_nap)(r3)49 cmpwi 0,r4,050 beqlr51
···38 /* We must dynamically check for the NAP feature as it39 * can be cleared by CPU init after the fixups are done40 */41+ LOAD_REG_ADDRBASE(r3,cur_cpu_spec)42+ ld r4,ADDROFF(cur_cpu_spec)(r3)43 ld r4,CPU_SPEC_FEATURES(r4)44 andi. r0,r4,CPU_FTR_CAN_NAP45 beqlr46 /* Now check if user or arch enabled NAP mode */47+ LOAD_REG_ADDRBASE(r3,powersave_nap)48+ lwz r4,ADDROFF(powersave_nap)(r3)49 cmpwi 0,r4,050 beqlr51
+4-8
arch/powerpc/kernel/irq.c
···238 irq_exit();239240#ifdef CONFIG_PPC_ISERIES241- {242- struct paca_struct *lpaca = get_paca();243-244- if (lpaca->lppaca.int_dword.fields.decr_int) {245- lpaca->lppaca.int_dword.fields.decr_int = 0;246- /* Signal a fake decrementer interrupt */247- timer_interrupt(regs);248- }249 }250#endif251}
···238 irq_exit();239240#ifdef CONFIG_PPC_ISERIES241+ if (get_lppaca()->int_dword.fields.decr_int) {242+ get_lppaca()->int_dword.fields.decr_int = 0;243+ /* Signal a fake decrementer interrupt */244+ timer_interrupt(regs);0000245 }246#endif247}
+5-8
arch/powerpc/kernel/lparcfg.c
···55{56 unsigned long sum_purr = 0;57 int cpu;58- struct paca_struct *lpaca;5960 for_each_cpu(cpu) {61- lpaca = paca + cpu;62- sum_purr += lpaca->lppaca.emulated_time_base;6364#ifdef PURR_DEBUG65 printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n",66- cpu, lpaca->lppaca.emulated_time_base);67#endif68 }69 return sum_purr;···77 unsigned long pool_id, lp_index;78 int shared, entitled_capacity, max_entitled_capacity;79 int processors, max_processors;80- struct paca_struct *lpaca = get_paca();81 unsigned long purr = get_purr();8283 seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);8485- shared = (int)(lpaca->lppaca_ptr->shared_proc);86 seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n",87 e2a(xItExtVpdPanel.mfgID[2]),88 e2a(xItExtVpdPanel.mfgID[3]),···399 (h_resource >> 0 * 8) & 0xffff);400401 /* pool related entries are apropriate for shared configs */402- if (paca[0].lppaca.shared_proc) {403404 h_pic(&pool_idle_time, &pool_procs);405···448 seq_printf(m, "partition_potential_processors=%d\n",449 partition_potential_processors);450451- seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.shared_proc);452453 return 0;454}
···55{56 unsigned long sum_purr = 0;57 int cpu;05859 for_each_cpu(cpu) {60+ sum_purr += lppaca[cpu].emulated_time_base;06162#ifdef PURR_DEBUG63 printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n",64+ cpu, lppaca[cpu].emulated_time_base);65#endif66 }67 return sum_purr;···79 unsigned long pool_id, lp_index;80 int shared, entitled_capacity, max_entitled_capacity;81 int processors, max_processors;082 unsigned long purr = get_purr();8384 seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);8586+ shared = (int)(get_lppaca()->shared_proc);87 seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n",88 e2a(xItExtVpdPanel.mfgID[2]),89 e2a(xItExtVpdPanel.mfgID[3]),···402 (h_resource >> 0 * 8) & 0xffff);403404 /* pool related entries are apropriate for shared configs */405+ if (lppaca[0].shared_proc) {406407 h_pic(&pool_idle_time, &pool_procs);408···451 seq_printf(m, "partition_potential_processors=%d\n",452 partition_potential_processors);453454+ seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc);455456 return 0;457}
···39 mflr r040 bl 1f411: mflr r342- LOADADDR(r4,1b)43 subf r3,r4,r344 mtlr r045 blr···51 mflr r052 bl 1f531: mflr r554- LOADADDR(r4,1b)55 subf r5,r4,r556 add r3,r3,r557 mtlr r0···498 */499_GLOBAL(do_cpu_ftr_fixups)500 /* Get CPU 0 features */501- LOADADDR(r6,cur_cpu_spec)502 sub r6,r6,r3503 ld r4,0(r6)504 sub r4,r4,r3505 ld r4,CPU_SPEC_FEATURES(r4)506 /* Get the fixup table */507- LOADADDR(r6,__start___ftr_fixup)508 sub r6,r6,r3509- LOADADDR(r7,__stop___ftr_fixup)510 sub r7,r7,r3511 /* Do the fixup */5121: cmpld r6,r7
···39 mflr r040 bl 1f411: mflr r342+ LOAD_REG_IMMEDIATE(r4,1b)43 subf r3,r4,r344 mtlr r045 blr···51 mflr r052 bl 1f531: mflr r554+ LOAD_REG_IMMEDIATE(r4,1b)55 subf r5,r4,r556 add r3,r3,r557 mtlr r0···498 */499_GLOBAL(do_cpu_ftr_fixups)500 /* Get CPU 0 features */501+ LOAD_REG_IMMEDIATE(r6,cur_cpu_spec)502 sub r6,r6,r3503 ld r4,0(r6)504 sub r4,r4,r3505 ld r4,CPU_SPEC_FEATURES(r4)506 /* Get the fixup table */507+ LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup)508 sub r6,r6,r3509+ LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup)510 sub r7,r7,r3511 /* Do the fixup */5121: cmpld r6,r7
+24-12
arch/powerpc/kernel/paca.c
···25 * field correctly */26extern unsigned long __toc_start;27000000000000000000000028/* The Paca is an array with one entry per processor. Each contains an29 * lppaca, which contains the information shared between the30 * hypervisor and Linux.···57 * processor (not thread).58 */59#define PACA_INIT_COMMON(number, start, asrr, asrv) \060 .lock_token = 0x8000, \61 .paca_index = (number), /* Paca Index */ \62 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \63 .stab_real = (asrr), /* Real pointer to segment table */ \64 .stab_addr = (asrv), /* Virt pointer to segment table */ \65 .cpu_start = (start), /* Processor start */ \66- .hw_cpu_id = 0xffff, \67- .lppaca = { \68- .desc = 0xd397d781, /* "LpPa" */ \69- .size = sizeof(struct lppaca), \70- .dyn_proc_status = 2, \71- .decr_val = 0x00ff0000, \72- .fpregs_in_use = 1, \73- .end_of_quantum = 0xfffffffffffffffful, \74- .slb_count = 64, \75- .vmxregs_in_use = 0, \76- }, \7778#ifdef CONFIG_PPC_ISERIES79#define PACA_INIT_ISERIES(number) \80- .lppaca_ptr = &paca[number].lppaca, \81 .reg_save_ptr = &iseries_reg_save[number],8283#define PACA_INIT(number) \
···25 * field correctly */26extern unsigned long __toc_start;2728+/*29+ * iSeries structure which the hypervisor knows about - this structure30+ * should not cross a page boundary. The vpa_init/register_vpa call31+ * is now known to fail if the lppaca structure crosses a page32+ * boundary. The lppaca is also used on POWER5 pSeries boxes. The33+ * lppaca is 640 bytes long, and cannot readily change since the34+ * hypervisor knows its layout, so a 1kB alignment will suffice to35+ * ensure that it doesn't cross a page boundary.36+ */37+struct lppaca lppaca[] = {38+ [0 ... (NR_CPUS-1)] = {39+ .desc = 0xd397d781, /* "LpPa" */40+ .size = sizeof(struct lppaca),41+ .dyn_proc_status = 2,42+ .decr_val = 0x00ff0000,43+ .fpregs_in_use = 1,44+ .end_of_quantum = 0xfffffffffffffffful,45+ .slb_count = 64,46+ .vmxregs_in_use = 0,47+ },48+};49+50/* The Paca is an array with one entry per processor. Each contains an51 * lppaca, which contains the information shared between the52 * hypervisor and Linux.···35 * processor (not thread).36 */37#define PACA_INIT_COMMON(number, start, asrr, asrv) \38+ .lppaca_ptr = &lppaca[number], \39 .lock_token = 0x8000, \40 .paca_index = (number), /* Paca Index */ \41 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \42 .stab_real = (asrr), /* Real pointer to segment table */ \43 .stab_addr = (asrv), /* Virt pointer to segment table */ \44 .cpu_start = (start), /* Processor start */ \45+ .hw_cpu_id = 0xffff,00000000004647#ifdef CONFIG_PPC_ISERIES48#define PACA_INIT_ISERIES(number) \049 .reg_save_ptr = &iseries_reg_save[number],5051#define PACA_INIT(number) \
···1627 kfree(prop->value);1628 kfree(prop);1629 prop = next;000001630 }1631 kfree(node->intrs);1632 kfree(node->full_name);···1779__initcall(prom_reconfig_setup);1780#endif1781000000000000000001782/*1783 * Find a property with a given name for a given node1784 * and return the value.···1803unsigned char *get_property(struct device_node *np, const char *name,1804 int *lenp)1805{1806- struct property *pp;1807-1808- for (pp = np->properties; pp != 0; pp = pp->next)1809- if (strcmp(pp->name, name) == 0) {1810- if (lenp != 0)1811- *lenp = pp->length;1812- return pp->value;1813- }1814- return NULL;1815}1816EXPORT_SYMBOL(get_property);1817···1838 return 0;1839}18400000000000184100000000000000000000000000000000000000000000000000000000000000000000
···1627 kfree(prop->value);1628 kfree(prop);1629 prop = next;1630+1631+ if (!prop) {1632+ prop = node->deadprops;1633+ node->deadprops = NULL;1634+ }1635 }1636 kfree(node->intrs);1637 kfree(node->full_name);···1774__initcall(prom_reconfig_setup);1775#endif17761777+struct property *of_find_property(struct device_node *np, const char *name,1778+ int *lenp)1779+{1780+ struct property *pp;1781+1782+ read_lock(&devtree_lock);1783+ for (pp = np->properties; pp != 0; pp = pp->next)1784+ if (strcmp(pp->name, name) == 0) {1785+ if (lenp != 0)1786+ *lenp = pp->length;1787+ break;1788+ }1789+ read_unlock(&devtree_lock);1790+1791+ return pp;1792+}1793+1794/*1795 * Find a property with a given name for a given node1796 * and return the value.···1781unsigned char *get_property(struct device_node *np, const char *name,1782 int *lenp)1783{1784+ struct property *pp = of_find_property(np,name,lenp);1785+ return pp ? pp->value : NULL;00000001786}1787EXPORT_SYMBOL(get_property);1788···1823 return 0;1824}18251826+/*1827+ * Remove a property from a node. Note that we don't actually1828+ * remove it, since we have given out who-knows-how-many pointers1829+ * to the data using get-property. Instead we just move the property1830+ * to the "dead properties" list, so it won't be found any more.1831+ */1832+int prom_remove_property(struct device_node *np, struct property *prop)1833+{1834+ struct property **next;1835+ int found = 0;18361837+ write_lock(&devtree_lock);1838+ next = &np->properties;1839+ while (*next) {1840+ if (*next == prop) {1841+ /* found the node */1842+ *next = prop->next;1843+ prop->next = np->deadprops;1844+ np->deadprops = prop;1845+ found = 1;1846+ break;1847+ }1848+ next = &(*next)->next;1849+ }1850+ write_unlock(&devtree_lock);1851+1852+ if (!found)1853+ return -ENODEV;1854+1855+#ifdef CONFIG_PROC_DEVICETREE1856+ /* try to remove the proc node as well */1857+ if (np->pde)1858+ proc_device_tree_remove_prop(np->pde, prop);1859+#endif /* CONFIG_PROC_DEVICETREE */1860+1861+ return 0;1862+}1863+1864+/*1865+ * Update a property in a node. Note that we don't actually1866+ * remove it, since we have given out who-knows-how-many pointers1867+ * to the data using get-property. Instead we just move the property1868+ * to the "dead properties" list, and add the new property to the1869+ * property list1870+ */1871+int prom_update_property(struct device_node *np,1872+ struct property *newprop,1873+ struct property *oldprop)1874+{1875+ struct property **next;1876+ int found = 0;1877+1878+ write_lock(&devtree_lock);1879+ next = &np->properties;1880+ while (*next) {1881+ if (*next == oldprop) {1882+ /* found the node */1883+ newprop->next = oldprop->next;1884+ *next = newprop;1885+ oldprop->next = np->deadprops;1886+ np->deadprops = oldprop;1887+ found = 1;1888+ break;1889+ }1890+ next = &(*next)->next;1891+ }1892+ write_unlock(&devtree_lock);1893+1894+ if (!found)1895+ return -ENODEV;1896+1897+#ifdef CONFIG_PROC_DEVICETREE1898+ /* try to add to proc as well if it was initialized */1899+ if (np->pde)1900+ proc_device_tree_update_prop(np->pde, newprop, oldprop);1901+#endif /* CONFIG_PROC_DEVICETREE */1902+1903+ return 0;1904+}
···113114static int of_bus_pci_match(struct device_node *np)115{116+ /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */117+ return !strcmp(np->type, "pci") || !strcmp(np->type, "vci");118}119120static void of_bus_pci_count_cells(struct device_node *np,
+95-1
arch/powerpc/kernel/rtas.c
···36 .lock = SPIN_LOCK_UNLOCKED37};380000039EXPORT_SYMBOL(rtas);4041DEFINE_SPINLOCK(rtas_data_buf_lock);···561 } while (status == RTAS_BUSY);562}56300000000000000000000000000000000000000000000000000000000000000000000000000564565asmlinkage int ppc_rtas(struct rtas_args __user *uargs)566{···642 unsigned long flags;643 char *buff_copy, *errbuf = NULL;644 int nargs;0645646 if (!capable(CAP_SYS_ADMIN))647 return -EPERM;···660 if (copy_from_user(args.args, uargs->args,661 nargs * sizeof(rtas_arg_t)) != 0)662 return -EFAULT;00000000000663664 buff_copy = get_errorlog_buffer();665···695 kfree(buff_copy);696 }6970698 /* Copy out args. */699 if (copy_to_user(uargs->args + nargs,700 args.args + nargs,···767 * the stop-self token if any768 */769#ifdef CONFIG_PPC64770- if (_machine == PLATFORM_PSERIES_LPAR)771 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX);00772#endif773 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region);774
···36 .lock = SPIN_LOCK_UNLOCKED37};3839+struct rtas_suspend_me_data {40+ long waiting;41+ struct rtas_args *args;42+};43+44EXPORT_SYMBOL(rtas);4546DEFINE_SPINLOCK(rtas_data_buf_lock);···556 } while (status == RTAS_BUSY);557}558559+static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;560+#ifdef CONFIG_PPC_PSERIES561+static void rtas_percpu_suspend_me(void *info)562+{563+ long rc;564+ long flags;565+ struct rtas_suspend_me_data *data =566+ (struct rtas_suspend_me_data *)info;567+568+ /*569+ * We use "waiting" to indicate our state. As long570+ * as it is >0, we are still trying to all join up.571+ * If it goes to 0, we have successfully joined up and572+ * one thread got H_Continue. If any error happens,573+ * we set it to <0.574+ */575+ local_irq_save(flags);576+ do {577+ rc = plpar_hcall_norets(H_JOIN);578+ smp_rmb();579+ } while (rc == H_Success && data->waiting > 0);580+ if (rc == H_Success)581+ goto out;582+583+ if (rc == H_Continue) {584+ data->waiting = 0;585+ rtas_call(ibm_suspend_me_token, 0, 1,586+ data->args->args);587+ } else {588+ data->waiting = -EBUSY;589+ printk(KERN_ERR "Error on H_Join hypervisor call\n");590+ }591+592+out:593+ /* before we restore interrupts, make sure we don't594+ * generate a spurious soft lockup errors595+ */596+ touch_softlockup_watchdog();597+ local_irq_restore(flags);598+ return;599+}600+601+static int rtas_ibm_suspend_me(struct rtas_args *args)602+{603+ int i;604+605+ struct rtas_suspend_me_data data;606+607+ data.waiting = 1;608+ data.args = args;609+610+ /* Call function on all CPUs. One of us will make the611+ * rtas call612+ */613+ if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))614+ data.waiting = -EINVAL;615+616+ if (data.waiting != 0)617+ printk(KERN_ERR "Error doing global join\n");618+619+ /* Prod each CPU. This won't hurt, and will wake620+ * anyone we successfully put to sleep with H_Join621+ */622+ for_each_cpu(i)623+ plpar_hcall_norets(H_PROD, i);624+625+ return data.waiting;626+}627+#else /* CONFIG_PPC_PSERIES */628+static int rtas_ibm_suspend_me(struct rtas_args *args)629+{630+ return -ENOSYS;631+}632+#endif633634asmlinkage int ppc_rtas(struct rtas_args __user *uargs)635{···563 unsigned long flags;564 char *buff_copy, *errbuf = NULL;565 int nargs;566+ int rc;567568 if (!capable(CAP_SYS_ADMIN))569 return -EPERM;···580 if (copy_from_user(args.args, uargs->args,581 nargs * sizeof(rtas_arg_t)) != 0)582 return -EFAULT;583+584+ if (args.token == RTAS_UNKNOWN_SERVICE)585+ return -EINVAL;586+587+ /* Need to handle ibm,suspend_me call specially */588+ if (args.token == ibm_suspend_me_token) {589+ rc = rtas_ibm_suspend_me(&args);590+ if (rc)591+ return rc;592+ goto copy_return;593+ }594595 buff_copy = get_errorlog_buffer();596···604 kfree(buff_copy);605 }606607+ copy_return:608 /* Copy out args. */609 if (copy_to_user(uargs->args + nargs,610 args.args + nargs,···675 * the stop-self token if any676 */677#ifdef CONFIG_PPC64678+ if (_machine == PLATFORM_PSERIES_LPAR) {679 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX);680+ ibm_suspend_me_token = rtas_token("ibm,suspend-me");681+ }682#endif683 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region);684
···28void __spin_yield(raw_spinlock_t *lock)29{30 unsigned int lock_value, holder_cpu, yield_count;31- struct paca_struct *holder_paca;3233 lock_value = lock->slock;34 if (lock_value == 0)35 return;36 holder_cpu = lock_value & 0xffff;37 BUG_ON(holder_cpu >= NR_CPUS);38- holder_paca = &paca[holder_cpu];39- yield_count = holder_paca->lppaca.yield_count;40 if ((yield_count & 1) == 0)41 return; /* virtual cpu is currently running */42 rmb();···58{59 int lock_value;60 unsigned int holder_cpu, yield_count;61- struct paca_struct *holder_paca;6263 lock_value = rw->lock;64 if (lock_value >= 0)65 return; /* no write lock at present */66 holder_cpu = lock_value & 0xffff;67 BUG_ON(holder_cpu >= NR_CPUS);68- holder_paca = &paca[holder_cpu];69- yield_count = holder_paca->lppaca.yield_count;70 if ((yield_count & 1) == 0)71 return; /* virtual cpu is currently running */72 rmb();
···28void __spin_yield(raw_spinlock_t *lock)29{30 unsigned int lock_value, holder_cpu, yield_count;03132 lock_value = lock->slock;33 if (lock_value == 0)34 return;35 holder_cpu = lock_value & 0xffff;36 BUG_ON(holder_cpu >= NR_CPUS);37+ yield_count = lppaca[holder_cpu].yield_count;038 if ((yield_count & 1) == 0)39 return; /* virtual cpu is currently running */40 rmb();···60{61 int lock_value;62 unsigned int holder_cpu, yield_count;06364 lock_value = rw->lock;65 if (lock_value >= 0)66 return; /* no write lock at present */67 holder_cpu = lock_value & 0xffff;68 BUG_ON(holder_cpu >= NR_CPUS);69+ yield_count = lppaca[holder_cpu].yield_count;070 if ((yield_count & 1) == 0)71 return; /* virtual cpu is currently running */72 rmb();
+4-4
arch/powerpc/oprofile/common.c
···140141 switch (cur_cpu_spec->oprofile_type) {142#ifdef CONFIG_PPC64143- case RS64:144 model = &op_model_rs64;145 break;146- case POWER4:147 model = &op_model_power4;148 break;149#else150- case G4:151 model = &op_model_7450;152 break;153#endif154#ifdef CONFIG_FSL_BOOKE155- case BOOKE:156 model = &op_model_fsl_booke;157 break;158#endif
···140141 switch (cur_cpu_spec->oprofile_type) {142#ifdef CONFIG_PPC64143+ case PPC_OPROFILE_RS64:144 model = &op_model_rs64;145 break;146+ case PPC_OPROFILE_POWER4:147 model = &op_model_power4;148 break;149#else150+ case PPC_OPROFILE_G4:151 model = &op_model_7450;152 break;153#endif154#ifdef CONFIG_FSL_BOOKE155+ case PPC_OPROFILE_BOOKE:156 model = &op_model_fsl_booke;157 break;158#endif
+1
arch/powerpc/platforms/83xx/Kconfig
···78config MPC834x_SYS9 bool "Freescale MPC834x SYS"010 help11 This option enables support for the MPC 834x SYS evaluation board.12
···78config MPC834x_SYS9 bool "Freescale MPC834x SYS"10+ select DEFAULT_UIMAGE11 help12 This option enables support for the MPC 834x SYS evaluation board.13
···1+/*2+ * arch/powerppc/platforms/83xx/mpc834x_sys.h3+ *4+ * MPC834X SYS common board definitions5+ *6+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>7+ *8+ * This program is free software; you can redistribute it and/or modify it9+ * under the terms of the GNU General Public License as published by the10+ * Free Software Foundation; either version 2 of the License, or (at your11+ * option) any later version.12+ *13+ */14+15+#ifndef __MACH_MPC83XX_SYS_H__16+#define __MACH_MPC83XX_SYS_H__17+18+#define PIRQA MPC83xx_IRQ_EXT419+#define PIRQB MPC83xx_IRQ_EXT520+#define PIRQC MPC83xx_IRQ_EXT621+#define PIRQD MPC83xx_IRQ_EXT722+23+#endif /* __MACH_MPC83XX_SYS_H__ */
+14
arch/powerpc/platforms/83xx/mpc83xx.h
···00000000000000
···1+#ifndef __MPC83XX_H__2+#define __MPC83XX_H__3+4+#include <linux/init.h>5+#include <linux/device.h>6+7+/*8+ * Declaration for the various functions exported by the9+ * mpc83xx_* files. Mostly for use by mpc83xx_setup10+ */11+12+extern int add_bridge(struct device_node *dev);13+14+#endif /* __MPC83XX_H__ */
···1+/*2+ * FSL SoC setup code3+ *4+ * Maintained by Kumar Gala (see MAINTAINERS for contact information)5+ *6+ * This program is free software; you can redistribute it and/or modify it7+ * under the terms of the GNU General Public License as published by the8+ * Free Software Foundation; either version 2 of the License, or (at your9+ * option) any later version.10+ */11+12+#include <linux/config.h>13+#include <linux/stddef.h>14+#include <linux/kernel.h>15+#include <linux/init.h>16+#include <linux/errno.h>17+#include <linux/pci.h>18+#include <linux/delay.h>19+#include <linux/irq.h>20+#include <linux/module.h>21+22+#include <asm/system.h>23+#include <asm/atomic.h>24+#include <asm/io.h>25+#include <asm/pci-bridge.h>26+#include <asm/prom.h>27+#include <sysdev/fsl_soc.h>28+29+#undef DEBUG30+31+#ifdef DEBUG32+#define DBG(x...) printk(x)33+#else34+#define DBG(x...)35+#endif36+37+int mpc83xx_pci2_busno;38+39+#ifdef CONFIG_PCI40+int __init add_bridge(struct device_node *dev)41+{42+ int len;43+ struct pci_controller *hose;44+ struct resource rsrc;45+ int *bus_range;46+ int primary = 1, has_address = 0;47+ phys_addr_t immr = get_immrbase();48+49+ DBG("Adding PCI host bridge %s\n", dev->full_name);50+51+ /* Fetch host bridge registers address */52+ has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);53+54+ /* Get bus range if any */55+ bus_range = (int *) get_property(dev, "bus-range", &len);56+ if (bus_range == NULL || len < 2 * sizeof(int)) {57+ printk(KERN_WARNING "Can't get bus-range for %s, assume"58+ " bus 0\n", dev->full_name);59+ }60+61+ hose = pcibios_alloc_controller();62+ if (!hose)63+ return -ENOMEM;64+ hose->arch_data = dev;65+ hose->set_cfg_type = 1;66+67+ hose->first_busno = bus_range ? bus_range[0] : 0;68+ hose->last_busno = bus_range ? bus_range[1] : 0xff;69+70+ /* MPC83xx supports up to two host controllers one at 0x8500 from immrbar71+ * the other at 0x8600, we consider the 0x8500 the primary controller72+ */73+ /* PCI 1 */74+ if ((rsrc.start & 0xfffff) == 0x8500) {75+ setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304);76+ }77+ /* PCI 2*/78+ if ((rsrc.start & 0xfffff) == 0x8600) {79+ setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);80+ primary = 0;81+ hose->bus_offset = hose->first_busno;82+ mpc83xx_pci2_busno = hose->first_busno;83+ }84+85+ printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. "86+ "Firmware bus number: %d->%d\n",87+ rsrc.start, hose->first_busno, hose->last_busno);88+89+ DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",90+ hose, hose->cfg_addr, hose->cfg_data);91+92+ /* Interpret the "ranges" property */93+ /* This also maps the I/O region and sets isa_io/mem_base */94+ pci_process_bridge_OF_ranges(hose, dev, primary);95+96+ return 0;97+}98+99+#endif
+17-10
arch/powerpc/platforms/chrp/pci.c
···135hydra_init(void)136{137 struct device_node *np;0138139 np = find_devices("mac-io");140- if (np == NULL || np->n_addrs == 0)141 return 0;142- Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);143- printk("Hydra Mac I/O at %lx\n", np->addrs[0].address);144 printk("Hydra Feature_Control was %x",145 in_le32(&Hydra->Feature_Control));146 out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |···178{179 u32 __iomem *reg;180 u32 val;181- unsigned long addr = dev->addrs[0].address;182183- setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);000184185 /* Clear the magic go-slow bit */186- reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);0187 val = in_be32(®[12]);188 if (val & PRG_CL_RESET_VALID) {189 out_be32(®[12], val & ~PRG_CL_RESET_VALID);190 in_be32(®[12]);191 }192 iounmap(reg);00193}194195/* Marvell Discovery II based Pegasos 2 */···225 char *model, *machine;226 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;227 struct device_node *root = find_path_device("/");228-229 /*230 * The PCI host bridge nodes on some machines don't have231 * properties to adequately identify them, so we have to···245 continue;246 ++index;247 /* The GG2 bridge on the LongTrail doesn't have an address */248- if (dev->n_addrs < 1 && !is_longtrail) {249 printk(KERN_WARNING "Can't use %s: no address\n",250 dev->full_name);251 continue;···262 printk(KERN_INFO "PCI buses %d..%d",263 bus_range[0], bus_range[1]);264 printk(" controlled by %s", dev->type);265- if (dev->n_addrs > 0)266- printk(" at %lx", dev->addrs[0].address);267 printk("\n");268269 hose = pcibios_alloc_controller();
···135hydra_init(void)136{137 struct device_node *np;138+ struct resource r;139140 np = find_devices("mac-io");141+ if (np == NULL || of_address_to_resource(np, 0, &r))142 return 0;143+ Hydra = ioremap(r.start, r.end-r.start);144+ printk("Hydra Mac I/O at %lx\n", r.start);145 printk("Hydra Feature_Control was %x",146 in_le32(&Hydra->Feature_Control));147 out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |···177{178 u32 __iomem *reg;179 u32 val;180+ struct resource r;181182+ if (of_address_to_resource(dev, 0, &r)) {183+ printk(KERN_ERR "No address for Python PCI controller\n");184+ return;185+ }186187 /* Clear the magic go-slow bit */188+ reg = ioremap(r.start + 0xf6000, 0x40);189+ BUG_ON(!reg); 190 val = in_be32(®[12]);191 if (val & PRG_CL_RESET_VALID) {192 out_be32(®[12], val & ~PRG_CL_RESET_VALID);193 in_be32(®[12]);194 }195 iounmap(reg);196+197+ setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010);198}199200/* Marvell Discovery II based Pegasos 2 */···218 char *model, *machine;219 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;220 struct device_node *root = find_path_device("/");221+ struct resource r;222 /*223 * The PCI host bridge nodes on some machines don't have224 * properties to adequately identify them, so we have to···238 continue;239 ++index;240 /* The GG2 bridge on the LongTrail doesn't have an address */241+ if (of_address_to_resource(dev, 0, &r) && !is_longtrail) {242 printk(KERN_WARNING "Can't use %s: no address\n",243 dev->full_name);244 continue;···255 printk(KERN_INFO "PCI buses %d..%d",256 bus_range[0], bus_range[1]);257 printk(" controlled by %s", dev->type);258+ if (!is_longtrail)259+ printk(" at %lx", r.start);260 printk("\n");261262 hose = pcibios_alloc_controller();
···334 */335int iSeries_get_irq(struct pt_regs *regs)336{337- struct paca_struct *lpaca;338 /* -2 means ignore this interrupt */339 int irq = -2;340341- lpaca = get_paca();342#ifdef CONFIG_SMP343- if (lpaca->lppaca.int_dword.fields.ipi_cnt) {344- lpaca->lppaca.int_dword.fields.ipi_cnt = 0;345 iSeries_smp_message_recv(regs);346 }347#endif /* CONFIG_SMP */
···334 */335int iSeries_get_irq(struct pt_regs *regs)336{0337 /* -2 means ignore this interrupt */338 int irq = -2;3390340#ifdef CONFIG_SMP341+ if (get_lppaca()->int_dword.fields.ipi_cnt) {342+ get_lppaca()->int_dword.fields.ipi_cnt = 0;343 iSeries_smp_message_recv(regs);344 }345#endif /* CONFIG_SMP */
+2-1
arch/powerpc/platforms/iseries/misc.S
···44 /* Check pending interrupts */45 /* A decrementer, IPI or PMC interrupt may have occurred46 * while we were in the hypervisor (which enables) */47- ld r4,PACALPPACA+LPPACAANYINT(r13)048 cmpdi r4,049 beqlr50
···44 /* Check pending interrupts */45 /* A decrementer, IPI or PMC interrupt may have occurred46 * while we were in the hypervisor (which enables) */47+ ld r4,PACALPPACAPTR(r13)48+ ld r4,LPPACAANYINT(r4)49 cmpdi r4,050 beqlr51
+4-4
arch/powerpc/platforms/iseries/setup.c
···538 */539static void __init iSeries_setup_arch(void)540{541- if (get_paca()->lppaca.shared_proc) {542 ppc_md.idle_loop = iseries_shared_idle;543 printk(KERN_INFO "Using shared processor idle loop\n");544 } else {···647 * The decrementer stops during the yield. Force a fake decrementer648 * here and let the timer_interrupt code sort out the actual time.649 */650- get_paca()->lppaca.int_dword.fields.decr_int = 1;651 process_iSeries_events();652}653···883 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE);884885 for (i = 0; i < NR_CPUS; i++) {886- if (paca[i].lppaca.dyn_proc_status >= 2)887 continue;888889 snprintf(p, 32 - (p - buf), "@%d", i);···891892 dt_prop_str(dt, "device_type", "cpu");893894- index = paca[i].lppaca.dyn_hv_phys_proc_index;895 d = &xIoHriProcessorVpd[index];896897 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
···538 */539static void __init iSeries_setup_arch(void)540{541+ if (get_lppaca()->shared_proc) {542 ppc_md.idle_loop = iseries_shared_idle;543 printk(KERN_INFO "Using shared processor idle loop\n");544 } else {···647 * The decrementer stops during the yield. Force a fake decrementer648 * here and let the timer_interrupt code sort out the actual time.649 */650+ get_lppaca()->int_dword.fields.decr_int = 1;651 process_iSeries_events();652}653···883 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE);884885 for (i = 0; i < NR_CPUS; i++) {886+ if (lppaca[i].dyn_proc_status >= 2)887 continue;888889 snprintf(p, 32 - (p - buf), "@%d", i);···891892 dt_prop_str(dt, "device_type", "cpu");893894+ index = lppaca[i].dyn_hv_phys_proc_index;895 d = &xIoHriProcessorVpd[index];896897 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
+1-1
arch/powerpc/platforms/iseries/smp.c
···91 BUG_ON((nr < 0) || (nr >= NR_CPUS));9293 /* Verify that our partition has a processor nr */94- if (paca[nr].lppaca.dyn_proc_status >= 2)95 return;9697 /* The processor is currently spinning, waiting
···91 BUG_ON((nr < 0) || (nr >= NR_CPUS));9293 /* Verify that our partition has a processor nr */94+ if (lppaca[nr].dyn_proc_status >= 2)95 return;9697 /* The processor is currently spinning, waiting
+2-2
arch/powerpc/platforms/pseries/lpar.c
···254void vpa_init(int cpu)255{256 int hwcpu = get_hard_smp_processor_id(cpu);257- unsigned long vpa = __pa(&paca[cpu].lppaca);258 long ret;259260 if (cpu_has_feature(CPU_FTR_ALTIVEC))261- paca[cpu].lppaca.vmxregs_in_use = 1;262263 ret = register_vpa(hwcpu, vpa);264
···254void vpa_init(int cpu)255{256 int hwcpu = get_hard_smp_processor_id(cpu);257+ unsigned long vpa = __pa(&lppaca[cpu]);258 long ret;259260 if (cpu_has_feature(CPU_FTR_ALTIVEC))261+ lppaca[cpu].vmxregs_in_use = 1;262263 ret = register_vpa(hwcpu, vpa);264
+100
arch/powerpc/platforms/pseries/reconfig.c
···350 return rv;351}3520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000353/**354 * ofdt_write - perform operations on the Open Firmware device tree355 *···486 rv = do_add_node(tmp, count - (tmp - kbuf));487 else if (!strcmp(kbuf, "remove_node"))488 rv = do_remove_node(tmp);000000489 else490 rv = -EINVAL;491out:
···190191 /* instruct hypervisor to maintain PMCs */192 if (firmware_has_feature(FW_FEATURE_SPLPAR))193- get_paca()->lppaca.pmcregs_in_use = 1;194}195196static void __init pSeries_setup_arch(void)···234 /* Choose an idle loop */235 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {236 vpa_init(boot_cpuid);237- if (get_paca()->lppaca.shared_proc) {238 printk(KERN_INFO "Using shared processor idle loop\n");239 ppc_md.idle_loop = pseries_shared_idle;240 } else {···444445static inline void dedicated_idle_sleep(unsigned int cpu)446{447- struct paca_struct *ppaca = &paca[cpu ^ 1];448449 /* Only sleep if the other thread is not idle */450- if (!(ppaca->lppaca.idle)) {451 local_irq_disable();452453 /*···480481static void pseries_dedicated_idle(void)482{ 483- struct paca_struct *lpaca = get_paca();484 unsigned int cpu = smp_processor_id();485 unsigned long start_snooze;486 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);···490 * Indicate to the HV that we are idle. Now would be491 * a good time to find other work to dispatch.492 */493- lpaca->lppaca.idle = 1;494495 if (!need_resched()) {496 start_snooze = get_tb() +···517 HMT_medium();518 }519520- lpaca->lppaca.idle = 0;521 ppc64_runlatch_on();522523 preempt_enable_no_resched();···531532static void pseries_shared_idle(void)533{534- struct paca_struct *lpaca = get_paca();535 unsigned int cpu = smp_processor_id();536537 while (1) {···538 * Indicate to the HV that we are idle. Now would be539 * a good time to find other work to dispatch.540 */541- lpaca->lppaca.idle = 1;542543 while (!need_resched() && !cpu_is_offline(cpu)) {544 local_irq_disable();···562 HMT_medium();563 }564565- lpaca->lppaca.idle = 0;566 ppc64_runlatch_on();567568 preempt_enable_no_resched();···586{587 /* Don't risk a hypervisor call if we're crashing */588 if (!crash_shutdown) {589- unsigned long vpa = __pa(&get_paca()->lppaca);590591 if (unregister_vpa(hard_smp_processor_id(), vpa)) {592 printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
···190191 /* instruct hypervisor to maintain PMCs */192 if (firmware_has_feature(FW_FEATURE_SPLPAR))193+ get_lppaca()->pmcregs_in_use = 1;194}195196static void __init pSeries_setup_arch(void)···234 /* Choose an idle loop */235 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {236 vpa_init(boot_cpuid);237+ if (get_lppaca()->shared_proc) {238 printk(KERN_INFO "Using shared processor idle loop\n");239 ppc_md.idle_loop = pseries_shared_idle;240 } else {···444445static inline void dedicated_idle_sleep(unsigned int cpu)446{447+ struct lppaca *plppaca = &lppaca[cpu ^ 1];448449 /* Only sleep if the other thread is not idle */450+ if (!(plppaca->idle)) {451 local_irq_disable();452453 /*···480481static void pseries_dedicated_idle(void)482{ 0483 unsigned int cpu = smp_processor_id();484 unsigned long start_snooze;485 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);···491 * Indicate to the HV that we are idle. Now would be492 * a good time to find other work to dispatch.493 */494+ get_lppaca()->idle = 1;495496 if (!need_resched()) {497 start_snooze = get_tb() +···518 HMT_medium();519 }520521+ get_lppaca()->idle = 0;522 ppc64_runlatch_on();523524 preempt_enable_no_resched();···532533static void pseries_shared_idle(void)534{0535 unsigned int cpu = smp_processor_id();536537 while (1) {···540 * Indicate to the HV that we are idle. Now would be541 * a good time to find other work to dispatch.542 */543+ get_lppaca()->idle = 1;544545 while (!need_resched() && !cpu_is_offline(cpu)) {546 local_irq_disable();···564 HMT_medium();565 }566567+ get_lppaca()->idle = 0;568 ppc64_runlatch_on();569570 preempt_enable_no_resched();···588{589 /* Don't risk a hypervisor call if we're crashing */590 if (!crash_shutdown) {591+ unsigned long vpa = __pa(get_lppaca());592593 if (unregister_vpa(hard_smp_processor_id(), vpa)) {594 printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
···375 lis r11, swapper_pg_dir@h376 ori r11, r11, swapper_pg_dir@l377 rlwimi r10, r11, 0, 2, 19003783:379 lwz r11, 0(r10) /* Get the level 1 entry */380 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */···431 . = 0x1300432InstructionTLBError:433 b InstructionAccess000000000000000000000000000000000000000000000000000000000000000000000000000434435/* This is the data TLB error on the MPC8xx. This could be due to436 * many reasons, including a dirty update to a pte. We can catch that
···375 lis r11, swapper_pg_dir@h376 ori r11, r11, swapper_pg_dir@l377 rlwimi r10, r11, 0, 2, 19378+ stw r12, 16(r0)379+ b LoadLargeDTLB3803:381 lwz r11, 0(r10) /* Get the level 1 entry */382 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */···429 . = 0x1300430InstructionTLBError:431 b InstructionAccess432+433+LoadLargeDTLB:434+ li r12, 0435+ lwz r11, 0(r10) /* Get the level 1 entry */436+ rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */437+ beq 3f /* If zero, don't try to find a pte */438+439+ /* We have a pte table, so load fetch the pte from the table.440+ */441+ ori r11, r11, 1 /* Set valid bit in physical L2 page */442+ DO_8xx_CPU6(0x3b80, r3)443+ mtspr SPRN_MD_TWC, r11 /* Load pte table base address */444+ mfspr r10, SPRN_MD_TWC /* ....and get the pte address */445+ lwz r10, 0(r10) /* Get the pte */446+447+ /* Insert the Guarded flag into the TWC from the Linux PTE.448+ * It is bit 27 of both the Linux PTE and the TWC (at least449+ * I got that right :-). It will be better when we can put450+ * this into the Linux pgd/pmd and load it in the operation451+ * above.452+ */453+ rlwimi r11, r10, 0, 27, 27454+455+ rlwimi r12, r10, 0, 0, 9 /* extract phys. addr */456+ mfspr r3, SPRN_MD_EPN457+ rlwinm r3, r3, 0, 0, 9 /* extract virtual address */458+ tophys(r3, r3)459+ cmpw r3, r12 /* only use 8M page if it is a direct 460+ kernel mapping */461+ bne 1f462+ ori r11, r11, MD_PS8MEG463+ li r12, 1464+ b 2f465+1:466+ li r12, 0 /* can't use 8MB TLB, so zero r12. */467+2:468+ DO_8xx_CPU6(0x3b80, r3)469+ mtspr SPRN_MD_TWC, r11470+471+ /* The Linux PTE won't go exactly into the MMU TLB.472+ * Software indicator bits 21, 22 and 28 must be clear.473+ * Software indicator bits 24, 25, 26, and 27 must be474+ * set. All other Linux PTE bits control the behavior475+ * of the MMU.476+ */477+3: li r11, 0x00f0478+ rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */479+ cmpwi r12, 1480+ bne 4f481+ ori r10, r10, 0x8482+483+ mfspr r12, SPRN_MD_EPN484+ lis r3, 0xff80 /* 10-19 must be clear for 8MB TLB */485+ ori r3, r3, 0x0fff486+ and r12, r3, r12487+ DO_8xx_CPU6(0x3780, r3)488+ mtspr SPRN_MD_EPN, r12489+490+ lis r3, 0xff80 /* 10-19 must be clear for 8MB TLB */491+ ori r3, r3, 0x0fff492+ and r10, r3, r10493+4:494+ DO_8xx_CPU6(0x3d80, r3)495+ mtspr SPRN_MD_RPN, r10 /* Update TLB entry */496+497+ mfspr r10, SPRN_M_TW /* Restore registers */498+ lwz r11, 0(r0)499+ mtcr r11500+ lwz r11, 4(r0)501+502+ lwz r12, 16(r0)503+#ifdef CONFIG_8xx_CPU6504+ lwz r3, 8(r0)505+#endif506+ rfi507508/* This is the data TLB error on the MPC8xx. This could be due to509 * many reasons, including a dirty update to a pte. We can catch that
···26 * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup27 */28struct gianfar_mdio_data mpc85xx_mdio_pdata = {29- .paddr = MPC85xx_MIIM_OFFSET,30};3132static struct gianfar_platform_data mpc85xx_tsec1_pdata = {···719 .name = "fsl-gianfar_mdio",720 .id = 0,721 .dev.platform_data = &mpc85xx_mdio_pdata,722- .num_resources = 0,0000000723 },724};725
···26 * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup27 */28struct gianfar_mdio_data mpc85xx_mdio_pdata = {029};3031static struct gianfar_platform_data mpc85xx_tsec1_pdata = {···720 .name = "fsl-gianfar_mdio",721 .id = 0,722 .dev.platform_data = &mpc85xx_mdio_pdata,723+ .num_resources = 1,724+ .resource = (struct resource[]) {725+ {726+ .start = 0x24520,727+ .end = 0x2453f,728+ .flags = IORESOURCE_MEM,729+ },730+ },731 },732};733
+8-5
drivers/macintosh/macio-adb.c
···17#include <asm/irq.h>18#include <asm/system.h>19#include <linux/init.h>02021struct preg {22 unsigned char r;···89int macio_init(void)90{91 struct device_node *adbs;09293 adbs = find_compatible_devices("adb", "chrp,adb0");94 if (adbs == 0)95 return -ENXIO;9697#if 098- { int i;99100 printk("macio_adb_init: node = %p, addrs =", adbs->node);101- for (i = 0; i < adbs->n_addrs; ++i)102- printk(" %x(%x)", adbs->addrs[i].address, adbs->addrs[i].size);103 printk(", intrs =");104 for (i = 0; i < adbs->n_intrs; ++i)105 printk(" %x", adbs->intrs[i].line);106 printk("\n"); }107#endif108-109- adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));0110111 out_8(&adb->ctrl.r, 0);112 out_8(&adb->intr.r, 0);
···17#include <asm/irq.h>18#include <asm/system.h>19#include <linux/init.h>20+#include <linux/ioport.h>2122struct preg {23 unsigned char r;···88int macio_init(void)89{90 struct device_node *adbs;91+ struct resource r;9293 adbs = find_compatible_devices("adb", "chrp,adb0");94 if (adbs == 0)95 return -ENXIO;9697#if 098+ { int i = 0;99100 printk("macio_adb_init: node = %p, addrs =", adbs->node);101+ while(!of_address_to_resource(adbs, i, &r))102+ printk(" %x(%x)", r.start, r.end - r.start);103 printk(", intrs =");104 for (i = 0; i < adbs->n_intrs; ++i)105 printk(" %x", adbs->intrs[i].line);106 printk("\n"); }107#endif108+ if (of_address_to_resource(adbs, 0, &r))109+ return -ENXIO;110+ adb = ioremap(r.start, sizeof(struct adb_regs));111112 out_8(&adb->ctrl.r, 0);113 out_8(&adb->intr.r, 0);
+24
fs/proc/proc_devtree.c
···81 __proc_device_tree_add_prop(pde, prop);82}8300000000000000000000000084/*85 * Process a node, adding entries for its children and its properties.86 */
···81 __proc_device_tree_add_prop(pde, prop);82}8384+void proc_device_tree_remove_prop(struct proc_dir_entry *pde,85+ struct property *prop)86+{87+ remove_proc_entry(prop->name, pde);88+}89+90+void proc_device_tree_update_prop(struct proc_dir_entry *pde,91+ struct property *newprop,92+ struct property *oldprop)93+{94+ struct proc_dir_entry *ent;95+96+ for (ent = pde->subdir; ent != NULL; ent = ent->next)97+ if (ent->data == oldprop)98+ break;99+ if (ent == NULL) {100+ printk(KERN_WARNING "device-tree: property \"%s\" "101+ " does not exist\n", oldprop->name);102+ } else {103+ ent->data = newprop;104+ ent->size = newprop->length;105+ }106+}107+108/*109 * Process a node, adding entries for its children and its properties.110 */
+23-23
include/asm-powerpc/atomic.h
···36 int t;3738 __asm__ __volatile__(39- EIEIO_ON_SMP40"1: lwarx %0,0,%2 # atomic_add_return\n\41 add %0,%1,%0\n"42 PPC405_ERR77(0,%2)···72 int t;7374 __asm__ __volatile__(75- EIEIO_ON_SMP76"1: lwarx %0,0,%2 # atomic_sub_return\n\77 subf %0,%1,%0\n"78 PPC405_ERR77(0,%2)···106 int t;107108 __asm__ __volatile__(109- EIEIO_ON_SMP110"1: lwarx %0,0,%1 # atomic_inc_return\n\111 addic %0,%0,1\n"112 PPC405_ERR77(0,%1)···150 int t;151152 __asm__ __volatile__(153- EIEIO_ON_SMP154"1: lwarx %0,0,%1 # atomic_dec_return\n\155 addic %0,%0,-1\n"156 PPC405_ERR77(0,%1)···176 * Atomically adds @a to @v, so long as it was not @u.177 * Returns non-zero if @v was not @u, and zero otherwise.178 */179-#define atomic_add_unless(v, a, u) \180-({ \181- int c, old; \182- c = atomic_read(v); \183- for (;;) { \184- if (unlikely(c == (u))) \185- break; \186- old = atomic_cmpxchg((v), c, c + (a)); \187- if (likely(old == c)) \188- break; \189- c = old; \190- } \191- c != (u); \192})193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)194···204 int t;205206 __asm__ __volatile__(207- EIEIO_ON_SMP208"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\209 addic. %0,%0,-1\n\210 blt- 2f\n"···253 long t;254255 __asm__ __volatile__(256- EIEIO_ON_SMP257"1: ldarx %0,0,%2 # atomic64_add_return\n\258 add %0,%1,%0\n\259 stdcx. %0,0,%2 \n\···287 long t;288289 __asm__ __volatile__(290- EIEIO_ON_SMP291"1: ldarx %0,0,%2 # atomic64_sub_return\n\292 subf %0,%1,%0\n\293 stdcx. %0,0,%2 \n\···319 long t;320321 __asm__ __volatile__(322- EIEIO_ON_SMP323"1: ldarx %0,0,%1 # atomic64_inc_return\n\324 addic %0,%0,1\n\325 stdcx. %0,0,%1 \n\···361 long t;362363 __asm__ __volatile__(364- EIEIO_ON_SMP365"1: ldarx %0,0,%1 # atomic64_dec_return\n\366 addic %0,%0,-1\n\367 stdcx. %0,0,%1\n\···386 long t;387388 __asm__ __volatile__(389- EIEIO_ON_SMP390"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\391 addic. %0,%0,-1\n\392 blt- 2f\n\
···36 int t;3738 __asm__ __volatile__(39+ LWSYNC_ON_SMP40"1: lwarx %0,0,%2 # atomic_add_return\n\41 add %0,%1,%0\n"42 PPC405_ERR77(0,%2)···72 int t;7374 __asm__ __volatile__(75+ LWSYNC_ON_SMP76"1: lwarx %0,0,%2 # atomic_sub_return\n\77 subf %0,%1,%0\n"78 PPC405_ERR77(0,%2)···106 int t;107108 __asm__ __volatile__(109+ LWSYNC_ON_SMP110"1: lwarx %0,0,%1 # atomic_inc_return\n\111 addic %0,%0,1\n"112 PPC405_ERR77(0,%1)···150 int t;151152 __asm__ __volatile__(153+ LWSYNC_ON_SMP154"1: lwarx %0,0,%1 # atomic_dec_return\n\155 addic %0,%0,-1\n"156 PPC405_ERR77(0,%1)···176 * Atomically adds @a to @v, so long as it was not @u.177 * Returns non-zero if @v was not @u, and zero otherwise.178 */179+#define atomic_add_unless(v, a, u) \180+({ \181+ int c, old; \182+ c = atomic_read(v); \183+ for (;;) { \184+ if (unlikely(c == (u))) \185+ break; \186+ old = atomic_cmpxchg((v), c, c + (a)); \187+ if (likely(old == c)) \188+ break; \189+ c = old; \190+ } \191+ c != (u); \192})193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)194···204 int t;205206 __asm__ __volatile__(207+ LWSYNC_ON_SMP208"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\209 addic. %0,%0,-1\n\210 blt- 2f\n"···253 long t;254255 __asm__ __volatile__(256+ LWSYNC_ON_SMP257"1: ldarx %0,0,%2 # atomic64_add_return\n\258 add %0,%1,%0\n\259 stdcx. %0,0,%2 \n\···287 long t;288289 __asm__ __volatile__(290+ LWSYNC_ON_SMP291"1: ldarx %0,0,%2 # atomic64_sub_return\n\292 subf %0,%1,%0\n\293 stdcx. %0,0,%2 \n\···319 long t;320321 __asm__ __volatile__(322+ LWSYNC_ON_SMP323"1: ldarx %0,0,%1 # atomic64_inc_return\n\324 addic %0,%0,1\n\325 stdcx. %0,0,%1 \n\···361 long t;362363 __asm__ __volatile__(364+ LWSYNC_ON_SMP365"1: ldarx %0,0,%1 # atomic64_dec_return\n\366 addic %0,%0,-1\n\367 stdcx. %0,0,%1\n\···386 long t;387388 __asm__ __volatile__(389+ LWSYNC_ON_SMP390"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\391 addic. %0,%0,-1\n\392 blt- 2f\n\
···221 instruction set this cpu supports. This could be done in userspace,222 but it's not easy, and we've already done it here. */223# define ELF_HWCAP (cur_cpu_spec->cpu_user_features)0000000224#ifdef __powerpc64__225# define ELF_PLAT_INIT(_r, load_addr) do { \226 _r->gpr[2] = load_addr; \227} while (0)228#endif /* __powerpc64__ */229-230-/* This yields a string that ld.so will use to load implementation231- specific libraries for optimization. This is more specific in232- intent than poking at uname or /proc/cpuinfo.233-234- For the moment, we have only optimizations for the Intel generations,235- but that could change... */236-237-#define ELF_PLATFORM (NULL)238239#ifdef __KERNEL__240
···221 instruction set this cpu supports. This could be done in userspace,222 but it's not easy, and we've already done it here. */223# define ELF_HWCAP (cur_cpu_spec->cpu_user_features)224+225+/* This yields a string that ld.so will use to load implementation226+ specific libraries for optimization. This is more specific in227+ intent than poking at uname or /proc/cpuinfo. */228+229+#define ELF_PLATFORM (cur_cpu_spec->platform)230+231#ifdef __powerpc64__232# define ELF_PLAT_INIT(_r, load_addr) do { \233 _r->gpr[2] = load_addr; \234} while (0)235#endif /* __powerpc64__ */000000000236237#ifdef __KERNEL__238
···67#define H_Success 08#define H_Busy 1 /* Hardware busy -- retry later */09#define H_Constrained 4 /* Resource request constrained to max allowed */0010#define H_LongBusyStartRange 9900 /* Start of long busy range */11#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */12#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */···117#define H_REGISTER_VTERM 0x154118#define H_FREE_VTERM 0x158119#define H_POLL_PENDING 0x1D800120121#ifndef __ASSEMBLY__122
···67#define H_Success 08#define H_Busy 1 /* Hardware busy -- retry later */9+#define H_Closed 2 /* Resource closed */10#define H_Constrained 4 /* Resource request constrained to max allowed */11+#define H_InProgress 14 /* Kind of like busy */12+#define H_Continue 18 /* Returned from H_Join on success */13#define H_LongBusyStartRange 9900 /* Start of long busy range */14#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */15#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */···114#define H_REGISTER_VTERM 0x154115#define H_FREE_VTERM 0x158116#define H_POLL_PENDING 0x1D8117+#define H_JOIN 0x298118+#define H_ENABLE_CRQ 0x2B0119120#ifndef __ASSEMBLY__121
+5-1
include/asm-powerpc/lppaca.h
···29//----------------------------------------------------------------------------30#include <asm/types.h>3132-struct lppaca {0033//=============================================================================34// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data35// NOTE: The xDynXyz fields are fields that will be dynamically changed by···130//=============================================================================131 u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF132};00133134#endif /* __KERNEL__ */135#endif /* _ASM_POWERPC_LPPACA_H */
···29//----------------------------------------------------------------------------30#include <asm/types.h>3132+/* The Hypervisor barfs if the lppaca crosses a page boundary. A 1k33+ * alignment is sufficient to prevent this */34+struct __attribute__((__aligned__(0x400))) lppaca {35//=============================================================================36// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data37// NOTE: The xDynXyz fields are fields that will be dynamically changed by···128//=============================================================================129 u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF130};131+132+extern struct lppaca lppaca[];133134#endif /* __KERNEL__ */135#endif /* _ASM_POWERPC_LPPACA_H */
+1-13
include/asm-powerpc/paca.h
···2324register struct paca_struct *local_paca asm("r13");25#define get_paca() local_paca02627struct task_struct;28···96 u64 saved_r1; /* r1 save for RTAS calls */97 u64 saved_msr; /* MSR saved here by enter_rtas */98 u8 proc_enabled; /* irq soft-enable flag */99-100- /*101- * iSeries structure which the hypervisor knows about -102- * this structure should not cross a page boundary.103- * The vpa_init/register_vpa call is now known to fail if the104- * lppaca structure crosses a page boundary.105- * The lppaca is also used on POWER5 pSeries boxes.106- * The lppaca is 640 bytes long, and cannot readily change107- * since the hypervisor knows its layout, so a 1kB108- * alignment will suffice to ensure that it doesn't109- * cross a page boundary.110- */111- struct lppaca lppaca __attribute__((__aligned__(0x400)));112};113114extern struct paca_struct paca[];
···2324register struct paca_struct *local_paca asm("r13");25#define get_paca() local_paca26+#define get_lppaca() (get_paca()->lppaca_ptr)2728struct task_struct;29···95 u64 saved_r1; /* r1 save for RTAS calls */96 u64 saved_msr; /* MSR saved here by enter_rtas */97 u8 proc_enabled; /* irq soft-enable flag */000000000000098};99100extern struct paca_struct paca[];
+38-34
include/asm-powerpc/ppc_asm.h
···156#endif157158/* 159- * LOADADDR( rn, name )160- * loads the address of 'name' into 'rn'000161 *162- * LOADBASE( rn, name )163- * loads the address (possibly without the low 16 bits) of 'name' into 'rn'164- * suitable for base+disp addressing0000000000000165 */166#ifdef __powerpc64__167-#define LOADADDR(rn,name) \168- lis rn,name##@highest; \169- ori rn,rn,name##@higher; \170- rldicr rn,rn,32,31; \171- oris rn,rn,name##@h; \172- ori rn,rn,name##@l173174-#define LOADBASE(rn,name) \175- ld rn,name@got(r2)176177-#define OFF(name) 0178-179-#define SET_REG_TO_CONST(reg, value) \180- lis reg,(((value)>>48)&0xFFFF); \181- ori reg,reg,(((value)>>32)&0xFFFF); \182- rldicr reg,reg,32,31; \183- oris reg,reg,(((value)>>16)&0xFFFF); \184- ori reg,reg,((value)&0xFFFF);185-186-#define SET_REG_TO_LABEL(reg, label) \187- lis reg,(label)@highest; \188- ori reg,reg,(label)@higher; \189- rldicr reg,reg,32,31; \190- oris reg,reg,(label)@h; \191- ori reg,reg,(label)@l;192193/* offsets for stack frame layout */194#define LRSAVE 16195196#else /* 32-bit */197-#define LOADADDR(rn,name) \198- lis rn,name@ha; \199- addi rn,rn,name@l200201-#define LOADBASE(rn,name) \202- lis rn,name@ha0203204-#define OFF(name) name@l000205206/* offsets for stack frame layout */207#define LRSAVE 4
···156#endif157158/* 159+ * LOAD_REG_IMMEDIATE(rn, expr)160+ * Loads the value of the constant expression 'expr' into register 'rn'161+ * using immediate instructions only. Use this when it's important not162+ * to reference other data (i.e. on ppc64 when the TOC pointer is not163+ * valid).164 *165+ * LOAD_REG_ADDR(rn, name)166+ * Loads the address of label 'name' into register 'rn'. Use this when167+ * you don't particularly need immediate instructions only, but you need168+ * the whole address in one register (e.g. it's a structure address and169+ * you want to access various offsets within it). On ppc32 this is170+ * identical to LOAD_REG_IMMEDIATE.171+ *172+ * LOAD_REG_ADDRBASE(rn, name)173+ * ADDROFF(name)174+ * LOAD_REG_ADDRBASE loads part of the address of label 'name' into175+ * register 'rn'. ADDROFF(name) returns the remainder of the address as176+ * a constant expression. ADDROFF(name) is a signed expression < 16 bits177+ * in size, so is suitable for use directly as an offset in load and store178+ * instructions. Use this when loading/storing a single word or less as:179+ * LOAD_REG_ADDRBASE(rX, name)180+ * ld rY,ADDROFF(name)(rX)181 */182#ifdef __powerpc64__183+#define LOAD_REG_IMMEDIATE(reg,expr) \184+ lis (reg),(expr)@highest; \185+ ori (reg),(reg),(expr)@higher; \186+ rldicr (reg),(reg),32,31; \187+ oris (reg),(reg),(expr)@h; \188+ ori (reg),(reg),(expr)@l;189190+#define LOAD_REG_ADDR(reg,name) \191+ ld (reg),name@got(r2)192193+#define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name)194+#define ADDROFF(name) 00000000000000195196/* offsets for stack frame layout */197#define LRSAVE 16198199#else /* 32-bit */000200201+#define LOAD_REG_IMMEDIATE(reg,expr) \202+ lis (reg),(expr)@ha; \203+ addi (reg),(reg),(expr)@l;204205+#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name)206+207+#define LOAD_REG_ADDRBASE(reg, name) lis (reg),name@ha208+#define ADDROFF(name) name@l209210/* offsets for stack frame layout */211#define LRSAVE 4