| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  *  arch/ppc/kernel/misc.S | 
 | 3 |  * | 
 | 4 |  *   | 
 | 5 |  * | 
 | 6 |  * This file contains miscellaneous low-level functions. | 
 | 7 |  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) | 
 | 8 |  * | 
 | 9 |  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu) | 
 | 10 |  * and Paul Mackerras. | 
 | 11 |  * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com) | 
 | 12 |  * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)  | 
 | 13 |  *  | 
 | 14 |  * This program is free software; you can redistribute it and/or | 
 | 15 |  * modify it under the terms of the GNU General Public License | 
 | 16 |  * as published by the Free Software Foundation; either version | 
 | 17 |  * 2 of the License, or (at your option) any later version. | 
 | 18 |  * | 
 | 19 |  */ | 
 | 20 |  | 
 | 21 | #include <linux/config.h> | 
 | 22 | #include <linux/sys.h> | 
 | 23 | #include <asm/unistd.h> | 
 | 24 | #include <asm/errno.h> | 
 | 25 | #include <asm/processor.h> | 
 | 26 | #include <asm/page.h> | 
 | 27 | #include <asm/cache.h> | 
 | 28 | #include <asm/ppc_asm.h> | 
| Sam Ravnborg | 0013a85 | 2005-09-09 20:57:26 +0200 | [diff] [blame^] | 29 | #include <asm/asm-offsets.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <asm/cputable.h> | 
 | 31 |  | 
 | 32 | 	.text | 
 | 33 |  | 
 | 34 | /* | 
| Paul Mackerras | 5e2afc1 | 2005-05-06 13:35:04 +1000 | [diff] [blame] | 35 |  * Returns (address we were linked at) - (address we are running at) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 |  * for use before the text and data are mapped to KERNELBASE. | 
 | 37 |  */ | 
 | 38 |  | 
 | 39 | _GLOBAL(reloc_offset) | 
 | 40 | 	mflr	r0 | 
 | 41 | 	bl	1f | 
 | 42 | 1:	mflr	r3 | 
 | 43 | 	LOADADDR(r4,1b) | 
 | 44 | 	sub	r3,r4,r3 | 
 | 45 | 	mtlr	r0 | 
 | 46 | 	blr | 
 | 47 |  | 
 | 48 | _GLOBAL(get_msr) | 
 | 49 | 	mfmsr	r3 | 
 | 50 | 	blr | 
 | 51 |  | 
 | 52 | _GLOBAL(get_dar) | 
 | 53 | 	mfdar	r3 | 
 | 54 | 	blr | 
 | 55 |  | 
 | 56 | _GLOBAL(get_srr0) | 
 | 57 | 	mfsrr0  r3 | 
 | 58 | 	blr | 
 | 59 |  | 
 | 60 | _GLOBAL(get_srr1) | 
 | 61 | 	mfsrr1  r3 | 
 | 62 | 	blr | 
 | 63 | 	 | 
 | 64 | _GLOBAL(get_sp) | 
 | 65 | 	mr	r3,r1 | 
 | 66 | 	blr | 
 | 67 | 		 | 
 | 68 | #ifdef CONFIG_PPC_ISERIES | 
 | 69 | /* unsigned long local_save_flags(void) */ | 
 | 70 | _GLOBAL(local_get_flags) | 
 | 71 | 	lbz	r3,PACAPROCENABLED(r13) | 
 | 72 | 	blr | 
 | 73 |  | 
 | 74 | /* unsigned long local_irq_disable(void) */ | 
 | 75 | _GLOBAL(local_irq_disable) | 
 | 76 | 	lbz	r3,PACAPROCENABLED(r13) | 
 | 77 | 	li	r4,0 | 
 | 78 | 	stb	r4,PACAPROCENABLED(r13) | 
 | 79 | 	blr			/* Done */ | 
 | 80 |  | 
 | 81 | /* void local_irq_restore(unsigned long flags) */	 | 
 | 82 | _GLOBAL(local_irq_restore) | 
 | 83 | 	lbz	r5,PACAPROCENABLED(r13) | 
 | 84 | 	 /* Check if things are setup the way we want _already_. */ | 
 | 85 | 	cmpw	0,r3,r5 | 
 | 86 | 	beqlr | 
 | 87 | 	/* are we enabling interrupts? */ | 
 | 88 | 	cmpdi	0,r3,0 | 
 | 89 | 	stb	r3,PACAPROCENABLED(r13) | 
 | 90 | 	beqlr | 
 | 91 | 	/* Check pending interrupts */ | 
 | 92 | 	/*   A decrementer, IPI or PMC interrupt may have occurred | 
 | 93 | 	 *   while we were in the hypervisor (which enables) */ | 
 | 94 | 	ld	r4,PACALPPACA+LPPACAANYINT(r13) | 
 | 95 | 	cmpdi	r4,0 | 
 | 96 | 	beqlr | 
 | 97 |  | 
 | 98 | 	/* | 
 | 99 | 	 * Handle pending interrupts in interrupt context | 
 | 100 | 	 */ | 
 | 101 | 	li	r0,0x5555 | 
 | 102 | 	sc | 
 | 103 | 	blr | 
 | 104 | #endif /* CONFIG_PPC_ISERIES */ | 
 | 105 |  | 
 | 106 | #ifdef CONFIG_IRQSTACKS | 
 | 107 | _GLOBAL(call_do_softirq) | 
 | 108 | 	mflr	r0 | 
 | 109 | 	std	r0,16(r1) | 
 | 110 | 	stdu	r1,THREAD_SIZE-112(r3) | 
 | 111 | 	mr	r1,r3 | 
 | 112 | 	bl	.__do_softirq | 
 | 113 | 	ld	r1,0(r1) | 
 | 114 | 	ld	r0,16(r1) | 
 | 115 | 	mtlr	r0 | 
 | 116 | 	blr | 
 | 117 |  | 
 | 118 | _GLOBAL(call_handle_IRQ_event) | 
 | 119 | 	mflr	r0 | 
 | 120 | 	std	r0,16(r1) | 
 | 121 | 	stdu	r1,THREAD_SIZE-112(r6) | 
 | 122 | 	mr	r1,r6 | 
 | 123 | 	bl	.handle_IRQ_event | 
 | 124 | 	ld	r1,0(r1) | 
 | 125 | 	ld	r0,16(r1) | 
 | 126 | 	mtlr	r0 | 
 | 127 | 	blr | 
 | 128 | #endif /* CONFIG_IRQSTACKS */ | 
 | 129 |  | 
 | 130 | 	/* | 
 | 131 |  * To be called by C code which needs to do some operations with MMU | 
 | 132 |  * disabled. Note that interrupts have to be disabled by the caller | 
 | 133 |  * prior to calling us. The code called _MUST_ be in the RMO of course | 
 | 134 |  * and part of the linear mapping as we don't attempt to translate the | 
 | 135 |  * stack pointer at all. The function is called with the stack switched | 
 | 136 |  * to this CPU emergency stack | 
 | 137 |  * | 
 | 138 |  * prototype is void *call_with_mmu_off(void *func, void *data); | 
 | 139 |  * | 
 | 140 |  * the called function is expected to be of the form | 
 | 141 |  * | 
 | 142 |  * void *called(void *data);  | 
 | 143 |  */ | 
 | 144 | _GLOBAL(call_with_mmu_off) | 
 | 145 | 	mflr	r0			/* get link, save it on stackframe */ | 
 | 146 | 	std	r0,16(r1) | 
 | 147 | 	mr	r1,r5			/* save old stack ptr */ | 
 | 148 | 	ld	r1,PACAEMERGSP(r13)	/* get emerg. stack */ | 
 | 149 | 	subi	r1,r1,STACK_FRAME_OVERHEAD | 
 | 150 | 	std	r0,16(r1)		/* save link on emerg. stack */ | 
 | 151 | 	std	r5,0(r1)		/* save old stack ptr in backchain */ | 
 | 152 | 	ld	r3,0(r3)		/* get to real function ptr (assume same TOC) */ | 
 | 153 | 	bl	2f			/* we need LR to return, continue at label 2 */ | 
 | 154 |  | 
 | 155 | 	ld	r0,16(r1)		/* we return here from the call, get LR and */ | 
 | 156 | 	ld	r1,0(r1)		/* .. old stack ptr */ | 
 | 157 | 	mtspr	SPRN_SRR0,r0		/* and get back to virtual mode with these */ | 
 | 158 | 	mfmsr	r4 | 
 | 159 | 	ori	r4,r4,MSR_IR|MSR_DR | 
 | 160 | 	mtspr	SPRN_SRR1,r4 | 
 | 161 | 	rfid | 
 | 162 |  | 
 | 163 | 2:	mtspr	SPRN_SRR0,r3		/* coming from above, enter real mode */ | 
 | 164 | 	mr	r3,r4			/* get parameter */ | 
 | 165 | 	mfmsr	r0 | 
 | 166 | 	ori	r0,r0,MSR_IR|MSR_DR | 
 | 167 | 	xori	r0,r0,MSR_IR|MSR_DR | 
 | 168 | 	mtspr	SPRN_SRR1,r0 | 
 | 169 | 	rfid | 
 | 170 |  | 
 | 171 |  | 
 | 172 | 	.section	".toc","aw" | 
 | 173 | PPC64_CACHES: | 
 | 174 | 	.tc		ppc64_caches[TC],ppc64_caches | 
 | 175 | 	.section	".text" | 
 | 176 |  | 
 | 177 | /* | 
 | 178 |  * Write any modified data cache blocks out to memory | 
 | 179 |  * and invalidate the corresponding instruction cache blocks. | 
 | 180 |  * | 
 | 181 |  * flush_icache_range(unsigned long start, unsigned long stop) | 
 | 182 |  * | 
 | 183 |  *   flush all bytes from start through stop-1 inclusive | 
 | 184 |  */ | 
 | 185 |  | 
| Prasanna S Panchamukhi | bb144a8 | 2005-09-06 15:19:29 -0700 | [diff] [blame] | 186 | _KPROBE(__flush_icache_range) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 |  | 
 | 188 | /* | 
 | 189 |  * Flush the data cache to memory  | 
 | 190 |  *  | 
 | 191 |  * Different systems have different cache line sizes | 
 | 192 |  * and in some cases i-cache and d-cache line sizes differ from | 
 | 193 |  * each other. | 
 | 194 |  */ | 
 | 195 |  	ld	r10,PPC64_CACHES@toc(r2) | 
 | 196 | 	lwz	r7,DCACHEL1LINESIZE(r10)/* Get cache line size */ | 
 | 197 | 	addi	r5,r7,-1 | 
 | 198 | 	andc	r6,r3,r5		/* round low to line bdy */ | 
 | 199 | 	subf	r8,r6,r4		/* compute length */ | 
 | 200 | 	add	r8,r8,r5		/* ensure we get enough */ | 
 | 201 | 	lwz	r9,DCACHEL1LOGLINESIZE(r10)	/* Get log-2 of cache line size */ | 
 | 202 | 	srw.	r8,r8,r9		/* compute line count */ | 
 | 203 | 	beqlr				/* nothing to do? */ | 
 | 204 | 	mtctr	r8 | 
 | 205 | 1:	dcbst	0,r6 | 
 | 206 | 	add	r6,r6,r7 | 
 | 207 | 	bdnz	1b | 
 | 208 | 	sync | 
 | 209 |  | 
 | 210 | /* Now invalidate the instruction cache */ | 
 | 211 | 	 | 
 | 212 | 	lwz	r7,ICACHEL1LINESIZE(r10)	/* Get Icache line size */ | 
 | 213 | 	addi	r5,r7,-1 | 
 | 214 | 	andc	r6,r3,r5		/* round low to line bdy */ | 
 | 215 | 	subf	r8,r6,r4		/* compute length */ | 
 | 216 | 	add	r8,r8,r5 | 
 | 217 | 	lwz	r9,ICACHEL1LOGLINESIZE(r10)	/* Get log-2 of Icache line size */ | 
 | 218 | 	srw.	r8,r8,r9		/* compute line count */ | 
 | 219 | 	beqlr				/* nothing to do? */ | 
 | 220 | 	mtctr	r8 | 
 | 221 | 2:	icbi	0,r6 | 
 | 222 | 	add	r6,r6,r7 | 
 | 223 | 	bdnz	2b | 
 | 224 | 	isync | 
 | 225 | 	blr | 
| Prasanna S Panchamukhi | bb144a8 | 2005-09-06 15:19:29 -0700 | [diff] [blame] | 226 | 	.previous .text | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | /* | 
 | 228 |  * Like above, but only do the D-cache. | 
 | 229 |  * | 
 | 230 |  * flush_dcache_range(unsigned long start, unsigned long stop) | 
 | 231 |  * | 
 | 232 |  *    flush all bytes from start to stop-1 inclusive | 
 | 233 |  */ | 
 | 234 | _GLOBAL(flush_dcache_range) | 
 | 235 |  | 
 | 236 | /* | 
 | 237 |  * Flush the data cache to memory  | 
 | 238 |  *  | 
 | 239 |  * Different systems have different cache line sizes | 
 | 240 |  */ | 
 | 241 |  	ld	r10,PPC64_CACHES@toc(r2) | 
 | 242 | 	lwz	r7,DCACHEL1LINESIZE(r10)	/* Get dcache line size */ | 
 | 243 | 	addi	r5,r7,-1 | 
 | 244 | 	andc	r6,r3,r5		/* round low to line bdy */ | 
 | 245 | 	subf	r8,r6,r4		/* compute length */ | 
 | 246 | 	add	r8,r8,r5		/* ensure we get enough */ | 
 | 247 | 	lwz	r9,DCACHEL1LOGLINESIZE(r10)	/* Get log-2 of dcache line size */ | 
 | 248 | 	srw.	r8,r8,r9		/* compute line count */ | 
 | 249 | 	beqlr				/* nothing to do? */ | 
 | 250 | 	mtctr	r8 | 
 | 251 | 0:	dcbst	0,r6 | 
 | 252 | 	add	r6,r6,r7 | 
 | 253 | 	bdnz	0b | 
 | 254 | 	sync | 
 | 255 | 	blr | 
 | 256 |  | 
 | 257 | /* | 
 | 258 |  * Like above, but works on non-mapped physical addresses. | 
 | 259 |  * Use only for non-LPAR setups ! It also assumes real mode | 
 | 260 |  * is cacheable. Used for flushing out the DART before using | 
 | 261 |  * it as uncacheable memory  | 
 | 262 |  * | 
 | 263 |  * flush_dcache_phys_range(unsigned long start, unsigned long stop) | 
 | 264 |  * | 
 | 265 |  *    flush all bytes from start to stop-1 inclusive | 
 | 266 |  */ | 
 | 267 | _GLOBAL(flush_dcache_phys_range) | 
 | 268 |  	ld	r10,PPC64_CACHES@toc(r2) | 
 | 269 | 	lwz	r7,DCACHEL1LINESIZE(r10)	/* Get dcache line size */ | 
 | 270 | 	addi	r5,r7,-1 | 
 | 271 | 	andc	r6,r3,r5		/* round low to line bdy */ | 
 | 272 | 	subf	r8,r6,r4		/* compute length */ | 
 | 273 | 	add	r8,r8,r5		/* ensure we get enough */ | 
 | 274 | 	lwz	r9,DCACHEL1LOGLINESIZE(r10)	/* Get log-2 of dcache line size */ | 
 | 275 | 	srw.	r8,r8,r9		/* compute line count */ | 
 | 276 | 	beqlr				/* nothing to do? */ | 
 | 277 | 	mfmsr	r5			/* Disable MMU Data Relocation */ | 
 | 278 | 	ori	r0,r5,MSR_DR | 
 | 279 | 	xori	r0,r0,MSR_DR | 
 | 280 | 	sync | 
 | 281 | 	mtmsr	r0 | 
 | 282 | 	sync | 
 | 283 | 	isync | 
 | 284 | 	mtctr	r8 | 
 | 285 | 0:	dcbst	0,r6 | 
 | 286 | 	add	r6,r6,r7 | 
 | 287 | 	bdnz	0b | 
 | 288 | 	sync | 
 | 289 | 	isync | 
 | 290 | 	mtmsr	r5			/* Re-enable MMU Data Relocation */ | 
 | 291 | 	sync | 
 | 292 | 	isync | 
 | 293 | 	blr | 
 | 294 |  | 
 | 295 | _GLOBAL(flush_inval_dcache_range) | 
 | 296 |  	ld	r10,PPC64_CACHES@toc(r2) | 
 | 297 | 	lwz	r7,DCACHEL1LINESIZE(r10)	/* Get dcache line size */ | 
 | 298 | 	addi	r5,r7,-1 | 
 | 299 | 	andc	r6,r3,r5		/* round low to line bdy */ | 
 | 300 | 	subf	r8,r6,r4		/* compute length */ | 
 | 301 | 	add	r8,r8,r5		/* ensure we get enough */ | 
 | 302 | 	lwz	r9,DCACHEL1LOGLINESIZE(r10)/* Get log-2 of dcache line size */ | 
 | 303 | 	srw.	r8,r8,r9		/* compute line count */ | 
 | 304 | 	beqlr				/* nothing to do? */ | 
 | 305 | 	sync | 
 | 306 | 	isync | 
 | 307 | 	mtctr	r8 | 
 | 308 | 0:	dcbf	0,r6 | 
 | 309 | 	add	r6,r6,r7 | 
 | 310 | 	bdnz	0b | 
 | 311 | 	sync | 
 | 312 | 	isync | 
 | 313 | 	blr | 
 | 314 |  | 
 | 315 |  | 
 | 316 | /* | 
 | 317 |  * Flush a particular page from the data cache to RAM. | 
 | 318 |  * Note: this is necessary because the instruction cache does *not* | 
 | 319 |  * snoop from the data cache. | 
 | 320 |  * | 
 | 321 |  *	void __flush_dcache_icache(void *page) | 
 | 322 |  */ | 
 | 323 | _GLOBAL(__flush_dcache_icache) | 
 | 324 | /* | 
 | 325 |  * Flush the data cache to memory  | 
 | 326 |  *  | 
 | 327 |  * Different systems have different cache line sizes | 
 | 328 |  */ | 
 | 329 |  | 
 | 330 | /* Flush the dcache */ | 
 | 331 |  	ld	r7,PPC64_CACHES@toc(r2) | 
 | 332 | 	clrrdi	r3,r3,12           	    /* Page align */ | 
 | 333 | 	lwz	r4,DCACHEL1LINESPERPAGE(r7)	/* Get # dcache lines per page */ | 
 | 334 | 	lwz	r5,DCACHEL1LINESIZE(r7)		/* Get dcache line size */ | 
 | 335 | 	mr	r6,r3 | 
 | 336 | 	mtctr	r4 | 
 | 337 | 0:	dcbst	0,r6 | 
 | 338 | 	add	r6,r6,r5 | 
 | 339 | 	bdnz	0b | 
 | 340 | 	sync | 
 | 341 |  | 
 | 342 | /* Now invalidate the icache */	 | 
 | 343 |  | 
 | 344 | 	lwz	r4,ICACHEL1LINESPERPAGE(r7)	/* Get # icache lines per page */ | 
 | 345 | 	lwz	r5,ICACHEL1LINESIZE(r7)		/* Get icache line size */ | 
 | 346 | 	mtctr	r4 | 
 | 347 | 1:	icbi	0,r3 | 
 | 348 | 	add	r3,r3,r5 | 
 | 349 | 	bdnz	1b | 
 | 350 | 	isync | 
 | 351 | 	blr | 
 | 352 | 	 | 
 | 353 | /* | 
 | 354 |  * I/O string operations | 
 | 355 |  * | 
 | 356 |  * insb(port, buf, len) | 
 | 357 |  * outsb(port, buf, len) | 
 | 358 |  * insw(port, buf, len) | 
 | 359 |  * outsw(port, buf, len) | 
 | 360 |  * insl(port, buf, len) | 
 | 361 |  * outsl(port, buf, len) | 
 | 362 |  * insw_ns(port, buf, len) | 
 | 363 |  * outsw_ns(port, buf, len) | 
 | 364 |  * insl_ns(port, buf, len) | 
 | 365 |  * outsl_ns(port, buf, len) | 
 | 366 |  * | 
 | 367 |  * The *_ns versions don't do byte-swapping. | 
 | 368 |  */ | 
 | 369 | _GLOBAL(_insb) | 
 | 370 | 	cmpwi	0,r5,0 | 
 | 371 | 	mtctr	r5 | 
 | 372 | 	subi	r4,r4,1 | 
 | 373 | 	blelr- | 
 | 374 | 00:	lbz	r5,0(r3) | 
 | 375 | 	eieio | 
 | 376 | 	stbu	r5,1(r4) | 
 | 377 | 	bdnz	00b | 
 | 378 | 	twi	0,r5,0 | 
 | 379 | 	isync | 
 | 380 | 	blr | 
 | 381 |  | 
 | 382 | _GLOBAL(_outsb) | 
 | 383 | 	cmpwi	0,r5,0 | 
 | 384 | 	mtctr	r5 | 
 | 385 | 	subi	r4,r4,1 | 
 | 386 | 	blelr- | 
 | 387 | 00:	lbzu	r5,1(r4) | 
 | 388 | 	stb	r5,0(r3) | 
 | 389 | 	bdnz	00b | 
 | 390 | 	sync | 
 | 391 | 	blr	 | 
 | 392 |  | 
 | 393 | _GLOBAL(_insw) | 
 | 394 | 	cmpwi	0,r5,0 | 
 | 395 | 	mtctr	r5 | 
 | 396 | 	subi	r4,r4,2 | 
 | 397 | 	blelr- | 
 | 398 | 00:	lhbrx	r5,0,r3 | 
 | 399 | 	eieio | 
 | 400 | 	sthu	r5,2(r4) | 
 | 401 | 	bdnz	00b | 
 | 402 | 	twi	0,r5,0 | 
 | 403 | 	isync | 
 | 404 | 	blr | 
 | 405 |  | 
 | 406 | _GLOBAL(_outsw) | 
 | 407 | 	cmpwi	0,r5,0 | 
 | 408 | 	mtctr	r5 | 
 | 409 | 	subi	r4,r4,2 | 
 | 410 | 	blelr- | 
 | 411 | 00:	lhzu	r5,2(r4) | 
 | 412 | 	sthbrx	r5,0,r3	 | 
 | 413 | 	bdnz	00b | 
 | 414 | 	sync | 
 | 415 | 	blr	 | 
 | 416 |  | 
 | 417 | _GLOBAL(_insl) | 
 | 418 | 	cmpwi	0,r5,0 | 
 | 419 | 	mtctr	r5 | 
 | 420 | 	subi	r4,r4,4 | 
 | 421 | 	blelr- | 
 | 422 | 00:	lwbrx	r5,0,r3 | 
 | 423 | 	eieio | 
 | 424 | 	stwu	r5,4(r4) | 
 | 425 | 	bdnz	00b | 
 | 426 | 	twi	0,r5,0 | 
 | 427 | 	isync | 
 | 428 | 	blr | 
 | 429 |  | 
 | 430 | _GLOBAL(_outsl) | 
 | 431 | 	cmpwi	0,r5,0 | 
 | 432 | 	mtctr	r5 | 
 | 433 | 	subi	r4,r4,4 | 
 | 434 | 	blelr- | 
 | 435 | 00:	lwzu	r5,4(r4) | 
 | 436 | 	stwbrx	r5,0,r3 | 
 | 437 | 	bdnz	00b | 
 | 438 | 	sync | 
 | 439 | 	blr	 | 
 | 440 |  | 
 | 441 | /* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */ | 
 | 442 | _GLOBAL(_insw_ns) | 
 | 443 | 	cmpwi	0,r5,0 | 
 | 444 | 	mtctr	r5 | 
 | 445 | 	subi	r4,r4,2 | 
 | 446 | 	blelr- | 
 | 447 | 00:	lhz	r5,0(r3) | 
 | 448 | 	eieio | 
 | 449 | 	sthu	r5,2(r4) | 
 | 450 | 	bdnz	00b | 
 | 451 | 	twi	0,r5,0 | 
 | 452 | 	isync | 
 | 453 | 	blr | 
 | 454 |  | 
 | 455 | /* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */ | 
 | 456 | _GLOBAL(_outsw_ns) | 
 | 457 | 	cmpwi	0,r5,0 | 
 | 458 | 	mtctr	r5 | 
 | 459 | 	subi	r4,r4,2 | 
 | 460 | 	blelr- | 
 | 461 | 00:	lhzu	r5,2(r4) | 
 | 462 | 	sth	r5,0(r3) | 
 | 463 | 	bdnz	00b | 
 | 464 | 	sync | 
 | 465 | 	blr	 | 
 | 466 |  | 
 | 467 | _GLOBAL(_insl_ns) | 
 | 468 | 	cmpwi	0,r5,0 | 
 | 469 | 	mtctr	r5 | 
 | 470 | 	subi	r4,r4,4 | 
 | 471 | 	blelr- | 
 | 472 | 00:	lwz	r5,0(r3) | 
 | 473 | 	eieio | 
 | 474 | 	stwu	r5,4(r4) | 
 | 475 | 	bdnz	00b | 
 | 476 | 	twi	0,r5,0 | 
 | 477 | 	isync | 
 | 478 | 	blr | 
 | 479 |  | 
 | 480 | _GLOBAL(_outsl_ns) | 
 | 481 | 	cmpwi	0,r5,0 | 
 | 482 | 	mtctr	r5 | 
 | 483 | 	subi	r4,r4,4 | 
 | 484 | 	blelr- | 
 | 485 | 00:	lwzu	r5,4(r4) | 
 | 486 | 	stw	r5,0(r3) | 
 | 487 | 	bdnz	00b | 
 | 488 | 	sync | 
 | 489 | 	blr	 | 
 | 490 |  | 
 | 491 |  | 
 | 492 | _GLOBAL(cvt_fd) | 
 | 493 | 	lfd	0,0(r5)		/* load up fpscr value */ | 
 | 494 | 	mtfsf	0xff,0 | 
 | 495 | 	lfs	0,0(r3) | 
 | 496 | 	stfd	0,0(r4) | 
 | 497 | 	mffs	0		/* save new fpscr value */ | 
 | 498 | 	stfd	0,0(r5) | 
 | 499 | 	blr | 
 | 500 |  | 
 | 501 | _GLOBAL(cvt_df) | 
 | 502 | 	lfd	0,0(r5)		/* load up fpscr value */ | 
 | 503 | 	mtfsf	0xff,0 | 
 | 504 | 	lfd	0,0(r3) | 
 | 505 | 	stfs	0,0(r4) | 
 | 506 | 	mffs	0		/* save new fpscr value */ | 
 | 507 | 	stfd	0,0(r5) | 
 | 508 | 	blr | 
 | 509 |  | 
 | 510 | /* | 
 | 511 |  * identify_cpu and calls setup_cpu | 
 | 512 |  * In:	r3 = base of the cpu_specs array | 
 | 513 |  *	r4 = address of cur_cpu_spec | 
 | 514 |  *	r5 = relocation offset | 
 | 515 |  */ | 
 | 516 | _GLOBAL(identify_cpu) | 
 | 517 | 	mfpvr	r7 | 
 | 518 | 1: | 
 | 519 | 	lwz	r8,CPU_SPEC_PVR_MASK(r3) | 
 | 520 | 	and	r8,r8,r7 | 
 | 521 | 	lwz	r9,CPU_SPEC_PVR_VALUE(r3) | 
 | 522 | 	cmplw	0,r9,r8 | 
 | 523 | 	beq	1f | 
 | 524 | 	addi	r3,r3,CPU_SPEC_ENTRY_SIZE | 
 | 525 | 	b	1b | 
 | 526 | 1: | 
 | 527 | 	add	r0,r3,r5 | 
 | 528 | 	std	r0,0(r4) | 
 | 529 | 	ld	r4,CPU_SPEC_SETUP(r3) | 
 | 530 | 	sub	r4,r4,r5 | 
 | 531 | 	ld	r4,0(r4) | 
 | 532 | 	sub	r4,r4,r5 | 
 | 533 | 	mtctr	r4 | 
 | 534 | 	/* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */ | 
 | 535 | 	mr	r4,r3 | 
 | 536 | 	mr	r3,r5 | 
 | 537 | 	bctr | 
 | 538 |  | 
 | 539 | /* | 
 | 540 |  * do_cpu_ftr_fixups - goes through the list of CPU feature fixups | 
 | 541 |  * and writes nop's over sections of code that don't apply for this cpu. | 
 | 542 |  * r3 = data offset (not changed) | 
 | 543 |  */ | 
 | 544 | _GLOBAL(do_cpu_ftr_fixups) | 
 | 545 | 	/* Get CPU 0 features */ | 
 | 546 | 	LOADADDR(r6,cur_cpu_spec) | 
 | 547 | 	sub	r6,r6,r3 | 
 | 548 | 	ld	r4,0(r6) | 
 | 549 | 	sub	r4,r4,r3 | 
 | 550 | 	ld	r4,CPU_SPEC_FEATURES(r4) | 
 | 551 | 	/* Get the fixup table */ | 
 | 552 | 	LOADADDR(r6,__start___ftr_fixup) | 
 | 553 | 	sub	r6,r6,r3 | 
 | 554 | 	LOADADDR(r7,__stop___ftr_fixup) | 
 | 555 | 	sub	r7,r7,r3 | 
 | 556 | 	/* Do the fixup */ | 
 | 557 | 1:	cmpld	r6,r7 | 
 | 558 | 	bgelr | 
 | 559 | 	addi	r6,r6,32 | 
 | 560 | 	ld	r8,-32(r6)	/* mask */ | 
 | 561 | 	and	r8,r8,r4 | 
 | 562 | 	ld	r9,-24(r6)	/* value */ | 
 | 563 | 	cmpld	r8,r9 | 
 | 564 | 	beq	1b | 
 | 565 | 	ld	r8,-16(r6)	/* section begin */ | 
 | 566 | 	ld	r9,-8(r6)	/* section end */ | 
 | 567 | 	subf.	r9,r8,r9 | 
 | 568 | 	beq	1b | 
 | 569 | 	/* write nops over the section of code */ | 
 | 570 | 	/* todo: if large section, add a branch at the start of it */ | 
 | 571 | 	srwi	r9,r9,2 | 
 | 572 | 	mtctr	r9 | 
 | 573 | 	sub	r8,r8,r3 | 
 | 574 | 	lis	r0,0x60000000@h	/* nop */ | 
 | 575 | 3:	stw	r0,0(r8) | 
 | 576 | 	andi.	r10,r4,CPU_FTR_SPLIT_ID_CACHE@l | 
 | 577 | 	beq	2f | 
 | 578 | 	dcbst	0,r8		/* suboptimal, but simpler */ | 
 | 579 | 	sync | 
 | 580 | 	icbi	0,r8 | 
 | 581 | 2:	addi	r8,r8,4 | 
 | 582 | 	bdnz	3b | 
 | 583 | 	sync			/* additional sync needed on g4 */ | 
 | 584 | 	isync | 
 | 585 | 	b	1b | 
 | 586 |  | 
 | 587 | #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) | 
 | 588 | /* | 
 | 589 |  * Do an IO access in real mode | 
 | 590 |  */ | 
 | 591 | _GLOBAL(real_readb) | 
 | 592 | 	mfmsr	r7 | 
 | 593 | 	ori	r0,r7,MSR_DR | 
 | 594 | 	xori	r0,r0,MSR_DR | 
 | 595 | 	sync | 
 | 596 | 	mtmsrd	r0 | 
 | 597 | 	sync | 
 | 598 | 	isync | 
 | 599 | 	mfspr	r6,SPRN_HID4 | 
 | 600 | 	rldicl	r5,r6,32,0 | 
 | 601 | 	ori	r5,r5,0x100 | 
 | 602 | 	rldicl	r5,r5,32,0 | 
 | 603 | 	sync | 
 | 604 | 	mtspr	SPRN_HID4,r5 | 
 | 605 | 	isync | 
 | 606 | 	slbia | 
 | 607 | 	isync | 
 | 608 | 	lbz	r3,0(r3) | 
 | 609 | 	sync | 
 | 610 | 	mtspr	SPRN_HID4,r6 | 
 | 611 | 	isync | 
 | 612 | 	slbia | 
 | 613 | 	isync | 
 | 614 | 	mtmsrd	r7 | 
 | 615 | 	sync | 
 | 616 | 	isync | 
 | 617 | 	blr | 
 | 618 |  | 
 | 619 | 	/* | 
 | 620 |  * Do an IO access in real mode | 
 | 621 |  */ | 
 | 622 | _GLOBAL(real_writeb) | 
 | 623 | 	mfmsr	r7 | 
 | 624 | 	ori	r0,r7,MSR_DR | 
 | 625 | 	xori	r0,r0,MSR_DR | 
 | 626 | 	sync | 
 | 627 | 	mtmsrd	r0 | 
 | 628 | 	sync | 
 | 629 | 	isync | 
 | 630 | 	mfspr	r6,SPRN_HID4 | 
 | 631 | 	rldicl	r5,r6,32,0 | 
 | 632 | 	ori	r5,r5,0x100 | 
 | 633 | 	rldicl	r5,r5,32,0 | 
 | 634 | 	sync | 
 | 635 | 	mtspr	SPRN_HID4,r5 | 
 | 636 | 	isync | 
 | 637 | 	slbia | 
 | 638 | 	isync | 
 | 639 | 	stb	r3,0(r4) | 
 | 640 | 	sync | 
 | 641 | 	mtspr	SPRN_HID4,r6 | 
 | 642 | 	isync | 
 | 643 | 	slbia | 
 | 644 | 	isync | 
 | 645 | 	mtmsrd	r7 | 
 | 646 | 	sync | 
 | 647 | 	isync | 
 | 648 | 	blr | 
 | 649 | #endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ | 
 | 650 |  | 
 | 651 | /* | 
 | 652 |  * Create a kernel thread | 
 | 653 |  *   kernel_thread(fn, arg, flags) | 
 | 654 |  */ | 
 | 655 | _GLOBAL(kernel_thread) | 
 | 656 | 	std	r29,-24(r1) | 
 | 657 | 	std	r30,-16(r1) | 
 | 658 | 	stdu	r1,-STACK_FRAME_OVERHEAD(r1) | 
 | 659 | 	mr	r29,r3 | 
 | 660 | 	mr	r30,r4 | 
 | 661 | 	ori	r3,r5,CLONE_VM	/* flags */ | 
 | 662 | 	oris	r3,r3,(CLONE_UNTRACED>>16) | 
 | 663 | 	li	r4,0		/* new sp (unused) */ | 
 | 664 | 	li	r0,__NR_clone | 
 | 665 | 	sc | 
 | 666 | 	cmpdi	0,r3,0		/* parent or child? */ | 
 | 667 | 	bne	1f		/* return if parent */ | 
 | 668 | 	li	r0,0 | 
 | 669 | 	stdu	r0,-STACK_FRAME_OVERHEAD(r1) | 
 | 670 | 	ld	r2,8(r29) | 
 | 671 | 	ld	r29,0(r29) | 
 | 672 | 	mtlr	r29              /* fn addr in lr */ | 
 | 673 | 	mr	r3,r30	        /* load arg and call fn */ | 
 | 674 | 	blrl | 
 | 675 | 	li	r0,__NR_exit	/* exit after child exits */ | 
 | 676 |         li	r3,0 | 
 | 677 | 	sc | 
 | 678 | 1:	addi	r1,r1,STACK_FRAME_OVERHEAD	 | 
 | 679 | 	ld	r29,-24(r1) | 
 | 680 | 	ld	r30,-16(r1) | 
 | 681 | 	blr | 
 | 682 |  | 
| David Gibson | 0ab2000 | 2005-08-19 14:52:31 +1000 | [diff] [blame] | 683 | /* | 
 | 684 |  * disable_kernel_fp() | 
 | 685 |  * Disable the FPU. | 
 | 686 |  */ | 
 | 687 | _GLOBAL(disable_kernel_fp) | 
 | 688 | 	mfmsr	r3 | 
 | 689 | 	rldicl	r0,r3,(63-MSR_FP_LG),1 | 
 | 690 | 	rldicl	r3,r0,(MSR_FP_LG+1),0 | 
 | 691 | 	mtmsrd	r3			/* disable use of fpu now */ | 
 | 692 | 	isync | 
 | 693 | 	blr | 
 | 694 |  | 
 | 695 | /* | 
 | 696 |  * giveup_fpu(tsk) | 
 | 697 |  * Disable FP for the task given as the argument, | 
 | 698 |  * and save the floating-point registers in its thread_struct. | 
 | 699 |  * Enables the FPU for use in the kernel on return. | 
 | 700 |  */ | 
 | 701 | _GLOBAL(giveup_fpu) | 
 | 702 | 	mfmsr	r5 | 
 | 703 | 	ori	r5,r5,MSR_FP | 
 | 704 | 	mtmsrd	r5			/* enable use of fpu now */ | 
 | 705 | 	isync | 
 | 706 | 	cmpdi	0,r3,0 | 
 | 707 | 	beqlr-				/* if no previous owner, done */ | 
 | 708 | 	addi	r3,r3,THREAD		/* want THREAD of task */ | 
 | 709 | 	ld	r5,PT_REGS(r3) | 
 | 710 | 	cmpdi	0,r5,0 | 
 | 711 | 	SAVE_32FPRS(0, r3) | 
 | 712 | 	mffs	fr0 | 
 | 713 | 	stfd	fr0,THREAD_FPSCR(r3) | 
 | 714 | 	beq	1f | 
 | 715 | 	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5) | 
 | 716 | 	li	r3,MSR_FP|MSR_FE0|MSR_FE1 | 
 | 717 | 	andc	r4,r4,r3		/* disable FP for previous task */ | 
 | 718 | 	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5) | 
 | 719 | 1: | 
 | 720 | #ifndef CONFIG_SMP | 
 | 721 | 	li	r5,0 | 
 | 722 | 	ld	r4,last_task_used_math@got(r2) | 
 | 723 | 	std	r5,0(r4) | 
 | 724 | #endif /* CONFIG_SMP */ | 
 | 725 | 	blr | 
 | 726 |  | 
 | 727 | #ifdef CONFIG_ALTIVEC | 
 | 728 |  | 
 | 729 | #if 0 /* this has no callers for now */ | 
 | 730 | /* | 
 | 731 |  * disable_kernel_altivec() | 
 | 732 |  * Disable the VMX. | 
 | 733 |  */ | 
 | 734 | _GLOBAL(disable_kernel_altivec) | 
 | 735 | 	mfmsr	r3 | 
 | 736 | 	rldicl	r0,r3,(63-MSR_VEC_LG),1 | 
 | 737 | 	rldicl	r3,r0,(MSR_VEC_LG+1),0 | 
 | 738 | 	mtmsrd	r3			/* disable use of VMX now */ | 
 | 739 | 	isync | 
 | 740 | 	blr | 
 | 741 | #endif /* 0 */ | 
 | 742 |  | 
 | 743 | /* | 
 | 744 |  * giveup_altivec(tsk) | 
 | 745 |  * Disable VMX for the task given as the argument, | 
 | 746 |  * and save the vector registers in its thread_struct. | 
 | 747 |  * Enables the VMX for use in the kernel on return. | 
 | 748 |  */ | 
 | 749 | _GLOBAL(giveup_altivec) | 
 | 750 | 	mfmsr	r5 | 
 | 751 | 	oris	r5,r5,MSR_VEC@h | 
 | 752 | 	mtmsrd	r5			/* enable use of VMX now */ | 
 | 753 | 	isync | 
 | 754 | 	cmpdi	0,r3,0 | 
 | 755 | 	beqlr-				/* if no previous owner, done */ | 
 | 756 | 	addi	r3,r3,THREAD		/* want THREAD of task */ | 
 | 757 | 	ld	r5,PT_REGS(r3) | 
 | 758 | 	cmpdi	0,r5,0 | 
 | 759 | 	SAVE_32VRS(0,r4,r3) | 
 | 760 | 	mfvscr	vr0 | 
 | 761 | 	li	r4,THREAD_VSCR | 
 | 762 | 	stvx	vr0,r4,r3 | 
 | 763 | 	beq	1f | 
 | 764 | 	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5) | 
 | 765 | 	lis	r3,MSR_VEC@h | 
 | 766 | 	andc	r4,r4,r3		/* disable FP for previous task */ | 
 | 767 | 	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5) | 
 | 768 | 1: | 
 | 769 | #ifndef CONFIG_SMP | 
 | 770 | 	li	r5,0 | 
 | 771 | 	ld	r4,last_task_used_altivec@got(r2) | 
 | 772 | 	std	r5,0(r4) | 
 | 773 | #endif /* CONFIG_SMP */ | 
 | 774 | 	blr | 
 | 775 |  | 
 | 776 | #endif /* CONFIG_ALTIVEC */ | 
 | 777 |  | 
 | 778 | _GLOBAL(__setup_cpu_power3) | 
 | 779 | 	blr | 
 | 780 |  | 
| R Sharada | fce0d57 | 2005-06-25 14:58:10 -0700 | [diff] [blame] | 781 | /* kexec_wait(phys_cpu) | 
 | 782 |  * | 
 | 783 |  * wait for the flag to change, indicating this kernel is going away but | 
 | 784 |  * the slave code for the next one is at addresses 0 to 100. | 
 | 785 |  * | 
 | 786 |  * This is used by all slaves. | 
 | 787 |  * | 
 | 788 |  * Physical (hardware) cpu id should be in r3. | 
 | 789 |  */ | 
 | 790 | _GLOBAL(kexec_wait) | 
 | 791 | 	bl	1f | 
 | 792 | 1:	mflr	r5 | 
 | 793 | 	addi	r5,r5,kexec_flag-1b | 
 | 794 |  | 
 | 795 | 99:	HMT_LOW | 
 | 796 | #ifdef CONFIG_KEXEC		/* use no memory without kexec */ | 
 | 797 | 	lwz	r4,0(r5) | 
 | 798 | 	cmpwi	0,r4,0 | 
 | 799 | 	bnea	0x60 | 
 | 800 | #endif | 
 | 801 | 	b	99b | 
 | 802 |  | 
 | 803 | /* this can be in text because we won't change it until we are | 
 | 804 |  * running in real anyways | 
 | 805 |  */ | 
 | 806 | kexec_flag: | 
 | 807 | 	.long	0 | 
 | 808 |  | 
 | 809 |  | 
 | 810 | #ifdef CONFIG_KEXEC | 
 | 811 |  | 
 | 812 | /* kexec_smp_wait(void) | 
 | 813 |  * | 
 | 814 |  * call with interrupts off | 
 | 815 |  * note: this is a terminal routine, it does not save lr | 
 | 816 |  * | 
 | 817 |  * get phys id from paca | 
 | 818 |  * set paca id to -1 to say we got here | 
 | 819 |  * switch to real mode | 
 | 820 |  * join other cpus in kexec_wait(phys_id) | 
 | 821 |  */ | 
 | 822 | _GLOBAL(kexec_smp_wait) | 
 | 823 | 	lhz	r3,PACAHWCPUID(r13) | 
 | 824 | 	li	r4,-1 | 
 | 825 | 	sth	r4,PACAHWCPUID(r13)	/* let others know we left */ | 
 | 826 | 	bl	real_mode | 
 | 827 | 	b	.kexec_wait | 
 | 828 |  | 
 | 829 | /* | 
 | 830 |  * switch to real mode (turn mmu off) | 
 | 831 |  * we use the early kernel trick that the hardware ignores bits | 
 | 832 |  * 0 and 1 (big endian) of the effective address in real mode | 
 | 833 |  * | 
 | 834 |  * don't overwrite r3 here, it is live for kexec_wait above. | 
 | 835 |  */ | 
 | 836 | real_mode:	/* assume normal blr return */ | 
 | 837 | 1:	li	r9,MSR_RI | 
 | 838 | 	li	r10,MSR_DR|MSR_IR | 
 | 839 | 	mflr	r11		/* return address to SRR0 */ | 
 | 840 | 	mfmsr	r12 | 
 | 841 | 	andc	r9,r12,r9 | 
 | 842 | 	andc	r10,r12,r10 | 
 | 843 |  | 
 | 844 | 	mtmsrd	r9,1 | 
 | 845 | 	mtspr	SPRN_SRR1,r10 | 
 | 846 | 	mtspr	SPRN_SRR0,r11 | 
 | 847 | 	rfid | 
 | 848 |  | 
 | 849 |  | 
 | 850 | /* | 
 | 851 |  * kexec_sequence(newstack, start, image, control, clear_all()) | 
 | 852 |  * | 
 | 853 |  * does the grungy work with stack switching and real mode switches | 
 | 854 |  * also does simple calls to other code | 
 | 855 |  */ | 
 | 856 |  | 
 | 857 | _GLOBAL(kexec_sequence) | 
 | 858 | 	mflr	r0 | 
 | 859 | 	std	r0,16(r1) | 
 | 860 |  | 
 | 861 | 	/* switch stacks to newstack -- &kexec_stack.stack */ | 
 | 862 | 	stdu	r1,THREAD_SIZE-112(r3) | 
 | 863 | 	mr	r1,r3 | 
 | 864 |  | 
 | 865 | 	li	r0,0 | 
 | 866 | 	std	r0,16(r1) | 
 | 867 |  | 
 | 868 | 	/* save regs for local vars on new stack. | 
 | 869 | 	 * yes, we won't go back, but ... | 
 | 870 | 	 */ | 
 | 871 | 	std	r31,-8(r1) | 
 | 872 | 	std	r30,-16(r1) | 
 | 873 | 	std	r29,-24(r1) | 
 | 874 | 	std	r28,-32(r1) | 
 | 875 | 	std	r27,-40(r1) | 
 | 876 | 	std	r26,-48(r1) | 
 | 877 | 	std	r25,-56(r1) | 
 | 878 |  | 
 | 879 | 	stdu	r1,-112-64(r1) | 
 | 880 |  | 
 | 881 | 	/* save args into preserved regs */ | 
 | 882 | 	mr	r31,r3			/* newstack (both) */ | 
 | 883 | 	mr	r30,r4			/* start (real) */ | 
 | 884 | 	mr	r29,r5			/* image (virt) */ | 
 | 885 | 	mr	r28,r6			/* control, unused */ | 
 | 886 | 	mr	r27,r7			/* clear_all() fn desc */ | 
 | 887 | 	mr	r26,r8			/* spare */ | 
 | 888 | 	lhz	r25,PACAHWCPUID(r13)	/* get our phys cpu from paca */ | 
 | 889 |  | 
 | 890 | 	/* disable interrupts, we are overwriting kernel data next */ | 
 | 891 | 	mfmsr	r3 | 
 | 892 | 	rlwinm	r3,r3,0,17,15 | 
 | 893 | 	mtmsrd	r3,1 | 
 | 894 |  | 
 | 895 | 	/* copy dest pages, flush whole dest image */ | 
 | 896 | 	mr	r3,r29 | 
 | 897 | 	bl	.kexec_copy_flush	/* (image) */ | 
 | 898 |  | 
 | 899 | 	/* turn off mmu */ | 
 | 900 | 	bl	real_mode | 
 | 901 |  | 
 | 902 | 	/* clear out hardware hash page table and tlb */ | 
 | 903 | 	ld	r5,0(r27)		/* deref function descriptor */ | 
 | 904 | 	mtctr	r5 | 
 | 905 | 	bctrl				/* ppc_md.hash_clear_all(void); */ | 
 | 906 |  | 
 | 907 | /* | 
 | 908 |  *   kexec image calling is: | 
 | 909 |  *      the first 0x100 bytes of the entry point are copied to 0 | 
 | 910 |  * | 
 | 911 |  *      all slaves branch to slave = 0x60 (absolute) | 
 | 912 |  *              slave(phys_cpu_id); | 
 | 913 |  * | 
 | 914 |  *      master goes to start = entry point | 
 | 915 |  *              start(phys_cpu_id, start, 0); | 
 | 916 |  * | 
 | 917 |  * | 
 | 918 |  *   a wrapper is needed to call existing kernels, here is an approximate | 
 | 919 |  *   description of one method: | 
 | 920 |  * | 
 | 921 |  * v2: (2.6.10) | 
 | 922 |  *   start will be near the boot_block (maybe 0x100 bytes before it?) | 
 | 923 |  *   it will have a 0x60, which will b to boot_block, where it will wait | 
 | 924 |  *   and 0 will store phys into struct boot-block and load r3 from there, | 
 | 925 |  *   copy kernel 0-0x100 and tell slaves to back down to 0x60 again | 
 | 926 |  * | 
 | 927 |  * v1: (2.6.9) | 
 | 928 |  *    boot block will have all cpus scanning device tree to see if they | 
 | 929 |  *    are the boot cpu ????? | 
 | 930 |  *    other device tree differences (prop sizes, va vs pa, etc)... | 
 | 931 |  */ | 
 | 932 |  | 
 | 933 | 	/* copy  0x100 bytes starting at start to 0 */ | 
 | 934 | 	li	r3,0 | 
 | 935 | 	mr	r4,r30 | 
 | 936 | 	li	r5,0x100 | 
 | 937 | 	li	r6,0 | 
 | 938 | 	bl	.copy_and_flush	/* (dest, src, copy limit, start offset) */ | 
 | 939 | 1:	/* assume normal blr return */ | 
 | 940 |  | 
 | 941 | 	/* release other cpus to the new kernel secondary start at 0x60 */ | 
 | 942 | 	mflr	r5 | 
 | 943 | 	li	r6,1 | 
 | 944 | 	stw	r6,kexec_flag-1b(5) | 
 | 945 | 	mr	r3,r25	# my phys cpu | 
 | 946 | 	mr	r4,r30	# start, aka phys mem offset | 
 | 947 | 	mtlr	4 | 
 | 948 | 	li	r5,0 | 
 | 949 | 	blr	/* image->start(physid, image->start, 0); */ | 
 | 950 | #endif /* CONFIG_KEXEC */ | 
 | 951 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 952 | /* Why isn't this a) automatic, b) written in 'C'? */	 | 
 | 953 | 	.balign 8 | 
 | 954 | _GLOBAL(sys_call_table32) | 
 | 955 | 	.llong .sys_restart_syscall	/* 0 */ | 
 | 956 | 	.llong .sys_exit | 
 | 957 | 	.llong .ppc_fork | 
 | 958 | 	.llong .sys_read | 
 | 959 | 	.llong .sys_write | 
| Miklos Szeredi | e922efc | 2005-09-06 15:18:25 -0700 | [diff] [blame] | 960 | 	.llong .compat_sys_open		/* 5 */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 961 | 	.llong .sys_close | 
 | 962 | 	.llong .sys32_waitpid | 
 | 963 | 	.llong .sys32_creat | 
 | 964 | 	.llong .sys_link | 
 | 965 | 	.llong .sys_unlink      	/* 10 */ | 
 | 966 | 	.llong .sys32_execve | 
 | 967 | 	.llong .sys_chdir | 
 | 968 | 	.llong .compat_sys_time | 
 | 969 | 	.llong .sys_mknod | 
 | 970 | 	.llong .sys_chmod		/* 15 */ | 
 | 971 | 	.llong .sys_lchown | 
 | 972 | 	.llong .sys_ni_syscall		/* old break syscall */ | 
 | 973 | 	.llong .sys_ni_syscall		/* old stat syscall */ | 
 | 974 | 	.llong .ppc32_lseek | 
 | 975 | 	.llong .sys_getpid              /* 20 */ | 
 | 976 | 	.llong .compat_sys_mount | 
 | 977 | 	.llong .sys_oldumount | 
 | 978 | 	.llong .sys_setuid | 
 | 979 | 	.llong .sys_getuid | 
 | 980 | 	.llong .compat_sys_stime	/* 25 */ | 
 | 981 | 	.llong .sys32_ptrace | 
 | 982 | 	.llong .sys_alarm | 
 | 983 | 	.llong .sys_ni_syscall		/* old fstat syscall */ | 
 | 984 | 	.llong .sys32_pause | 
 | 985 | 	.llong .compat_sys_utime		/* 30 */ | 
 | 986 | 	.llong .sys_ni_syscall		/* old stty syscall */ | 
 | 987 | 	.llong .sys_ni_syscall		/* old gtty syscall */ | 
 | 988 | 	.llong .sys32_access | 
 | 989 | 	.llong .sys32_nice | 
 | 990 | 	.llong .sys_ni_syscall		/* 35 - old ftime syscall */ | 
 | 991 | 	.llong .sys_sync | 
 | 992 | 	.llong .sys32_kill | 
 | 993 | 	.llong .sys_rename | 
 | 994 | 	.llong .sys32_mkdir | 
 | 995 | 	.llong .sys_rmdir		/* 40 */ | 
 | 996 | 	.llong .sys_dup | 
 | 997 | 	.llong .sys_pipe | 
 | 998 | 	.llong .compat_sys_times | 
 | 999 | 	.llong .sys_ni_syscall		/* old prof syscall */ | 
 | 1000 | 	.llong .sys_brk			/* 45 */ | 
 | 1001 | 	.llong .sys_setgid | 
 | 1002 | 	.llong .sys_getgid | 
 | 1003 | 	.llong .sys_signal | 
 | 1004 | 	.llong .sys_geteuid | 
 | 1005 | 	.llong .sys_getegid		/* 50 */ | 
 | 1006 | 	.llong .sys_acct | 
 | 1007 | 	.llong .sys_umount | 
 | 1008 | 	.llong .sys_ni_syscall		/* old lock syscall */ | 
 | 1009 | 	.llong .compat_sys_ioctl | 
 | 1010 | 	.llong .compat_sys_fcntl		/* 55 */ | 
 | 1011 | 	.llong .sys_ni_syscall		/* old mpx syscall */ | 
 | 1012 | 	.llong .sys32_setpgid | 
 | 1013 | 	.llong .sys_ni_syscall		/* old ulimit syscall */ | 
 | 1014 | 	.llong .sys32_olduname | 
 | 1015 | 	.llong .sys32_umask		/* 60 */ | 
 | 1016 | 	.llong .sys_chroot | 
 | 1017 | 	.llong .sys_ustat | 
 | 1018 | 	.llong .sys_dup2 | 
 | 1019 | 	.llong .sys_getppid | 
 | 1020 | 	.llong .sys_getpgrp	        /* 65 */ | 
 | 1021 | 	.llong .sys_setsid | 
 | 1022 | 	.llong .sys32_sigaction | 
 | 1023 | 	.llong .sys_sgetmask | 
 | 1024 | 	.llong .sys32_ssetmask | 
 | 1025 | 	.llong .sys_setreuid	        /* 70 */ | 
 | 1026 | 	.llong .sys_setregid | 
 | 1027 | 	.llong .ppc32_sigsuspend | 
 | 1028 | 	.llong .compat_sys_sigpending | 
 | 1029 | 	.llong .sys32_sethostname | 
 | 1030 | 	.llong .compat_sys_setrlimit	        /* 75 */ | 
 | 1031 | 	.llong .compat_sys_old_getrlimit | 
 | 1032 | 	.llong .compat_sys_getrusage | 
 | 1033 | 	.llong .sys32_gettimeofday | 
 | 1034 | 	.llong .sys32_settimeofday | 
 | 1035 | 	.llong .sys32_getgroups	        /* 80 */ | 
 | 1036 | 	.llong .sys32_setgroups | 
 | 1037 | 	.llong .sys_ni_syscall		/* old select syscall */ | 
 | 1038 | 	.llong .sys_symlink | 
 | 1039 | 	.llong .sys_ni_syscall		/* old lstat syscall */ | 
 | 1040 | 	.llong .sys32_readlink	        /* 85 */ | 
 | 1041 | 	.llong .sys_uselib | 
 | 1042 | 	.llong .sys_swapon | 
 | 1043 | 	.llong .sys_reboot | 
 | 1044 | 	.llong .old32_readdir | 
 | 1045 | 	.llong .sys_mmap		/* 90 */ | 
 | 1046 | 	.llong .sys_munmap | 
 | 1047 | 	.llong .sys_truncate | 
 | 1048 | 	.llong .sys_ftruncate | 
 | 1049 | 	.llong .sys_fchmod | 
 | 1050 | 	.llong .sys_fchown              /* 95 */ | 
 | 1051 | 	.llong .sys32_getpriority | 
 | 1052 | 	.llong .sys32_setpriority | 
 | 1053 | 	.llong .sys_ni_syscall		/* old profil syscall */ | 
 | 1054 | 	.llong .compat_sys_statfs | 
 | 1055 | 	.llong .compat_sys_fstatfs		/* 100 */ | 
 | 1056 | 	.llong .sys_ni_syscall		/* old ioperm syscall */ | 
 | 1057 | 	.llong .compat_sys_socketcall | 
 | 1058 | 	.llong .sys32_syslog | 
 | 1059 | 	.llong .compat_sys_setitimer | 
 | 1060 | 	.llong .compat_sys_getitimer		/* 105 */ | 
 | 1061 | 	.llong .compat_sys_newstat | 
 | 1062 | 	.llong .compat_sys_newlstat | 
 | 1063 | 	.llong .compat_sys_newfstat | 
| Paul Mackerras | ce10d97 | 2005-06-08 21:59:15 +1000 | [diff] [blame] | 1064 | 	.llong .sys32_uname | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1065 | 	.llong .sys_ni_syscall		/* 110 old iopl syscall */ | 
 | 1066 | 	.llong .sys_vhangup | 
 | 1067 | 	.llong .sys_ni_syscall		/* old idle syscall */ | 
 | 1068 | 	.llong .sys_ni_syscall		/* old vm86 syscall */ | 
 | 1069 | 	.llong .compat_sys_wait4 | 
 | 1070 | 	.llong .sys_swapoff		/* 115 */ | 
 | 1071 | 	.llong .sys32_sysinfo | 
 | 1072 | 	.llong .sys32_ipc | 
 | 1073 | 	.llong .sys_fsync | 
 | 1074 | 	.llong .ppc32_sigreturn | 
 | 1075 | 	.llong .ppc_clone		/* 120 */ | 
 | 1076 | 	.llong .sys32_setdomainname | 
 | 1077 | 	.llong .ppc64_newuname | 
 | 1078 | 	.llong .sys_ni_syscall		/* old modify_ldt syscall */ | 
 | 1079 | 	.llong .sys32_adjtimex | 
 | 1080 | 	.llong .sys_mprotect		/* 125 */ | 
 | 1081 | 	.llong .compat_sys_sigprocmask | 
 | 1082 | 	.llong .sys_ni_syscall		/* old create_module syscall */ | 
 | 1083 | 	.llong .sys_init_module | 
 | 1084 | 	.llong .sys_delete_module | 
 | 1085 | 	.llong .sys_ni_syscall		/* 130 old get_kernel_syms syscall */ | 
 | 1086 | 	.llong .sys_quotactl | 
 | 1087 | 	.llong .sys32_getpgid | 
 | 1088 | 	.llong .sys_fchdir | 
 | 1089 | 	.llong .sys_bdflush | 
 | 1090 | 	.llong .sys32_sysfs		/* 135 */ | 
 | 1091 | 	.llong .ppc64_personality | 
 | 1092 | 	.llong .sys_ni_syscall	        /* for afs_syscall */ | 
 | 1093 | 	.llong .sys_setfsuid | 
 | 1094 | 	.llong .sys_setfsgid | 
 | 1095 | 	.llong .sys_llseek	        /* 140 */ | 
 | 1096 |         .llong .sys32_getdents | 
 | 1097 | 	.llong .ppc32_select | 
 | 1098 | 	.llong .sys_flock | 
 | 1099 | 	.llong .sys_msync | 
 | 1100 | 	.llong .compat_sys_readv	/* 145 */ | 
 | 1101 | 	.llong .compat_sys_writev | 
 | 1102 | 	.llong .sys32_getsid | 
 | 1103 | 	.llong .sys_fdatasync | 
 | 1104 | 	.llong .sys32_sysctl | 
 | 1105 | 	.llong .sys_mlock		/* 150 */ | 
 | 1106 | 	.llong .sys_munlock | 
 | 1107 | 	.llong .sys_mlockall | 
 | 1108 | 	.llong .sys_munlockall | 
 | 1109 | 	.llong .sys32_sched_setparam | 
 | 1110 | 	.llong .sys32_sched_getparam	/* 155 */ | 
 | 1111 | 	.llong .sys32_sched_setscheduler | 
 | 1112 | 	.llong .sys32_sched_getscheduler | 
 | 1113 | 	.llong .sys_sched_yield | 
 | 1114 | 	.llong .sys32_sched_get_priority_max | 
 | 1115 | 	.llong .sys32_sched_get_priority_min  /* 160 */ | 
 | 1116 | 	.llong .sys32_sched_rr_get_interval | 
 | 1117 | 	.llong .compat_sys_nanosleep | 
 | 1118 | 	.llong .sys_mremap | 
 | 1119 | 	.llong .sys_setresuid | 
 | 1120 | 	.llong .sys_getresuid	        /* 165 */ | 
 | 1121 | 	.llong .sys_ni_syscall		/* old query_module syscall */ | 
 | 1122 | 	.llong .sys_poll | 
 | 1123 | 	.llong .compat_sys_nfsservctl | 
 | 1124 | 	.llong .sys_setresgid | 
 | 1125 | 	.llong .sys_getresgid	        /* 170 */ | 
 | 1126 | 	.llong .sys32_prctl | 
 | 1127 | 	.llong .ppc32_rt_sigreturn | 
 | 1128 | 	.llong .sys32_rt_sigaction | 
 | 1129 | 	.llong .sys32_rt_sigprocmask | 
 | 1130 | 	.llong .sys32_rt_sigpending     /* 175 */ | 
 | 1131 | 	.llong .compat_sys_rt_sigtimedwait | 
 | 1132 | 	.llong .sys32_rt_sigqueueinfo | 
 | 1133 | 	.llong .ppc32_rt_sigsuspend | 
 | 1134 | 	.llong .sys32_pread64 | 
 | 1135 | 	.llong .sys32_pwrite64	        /* 180 */ | 
 | 1136 | 	.llong .sys_chown | 
 | 1137 | 	.llong .sys_getcwd | 
 | 1138 | 	.llong .sys_capget | 
 | 1139 | 	.llong .sys_capset | 
 | 1140 | 	.llong .sys32_sigaltstack	/* 185 */ | 
 | 1141 | 	.llong .sys32_sendfile | 
 | 1142 | 	.llong .sys_ni_syscall		/* reserved for streams1 */ | 
 | 1143 | 	.llong .sys_ni_syscall		/* reserved for streams2 */ | 
 | 1144 | 	.llong .ppc_vfork | 
 | 1145 | 	.llong .compat_sys_getrlimit	        /* 190 */ | 
 | 1146 | 	.llong .sys32_readahead | 
 | 1147 | 	.llong .sys32_mmap2 | 
 | 1148 | 	.llong .sys32_truncate64 | 
 | 1149 | 	.llong .sys32_ftruncate64 | 
 | 1150 | 	.llong .sys_stat64      	/* 195 */ | 
 | 1151 | 	.llong .sys_lstat64 | 
 | 1152 | 	.llong .sys_fstat64 | 
 | 1153 | 	.llong .sys32_pciconfig_read | 
 | 1154 | 	.llong .sys32_pciconfig_write | 
 | 1155 | 	.llong .sys32_pciconfig_iobase	/* 200 - pciconfig_iobase */ | 
 | 1156 | 	.llong .sys_ni_syscall		/* reserved for MacOnLinux */ | 
 | 1157 | 	.llong .sys_getdents64 | 
 | 1158 | 	.llong .sys_pivot_root | 
 | 1159 | 	.llong .compat_sys_fcntl64 | 
 | 1160 | 	.llong .sys_madvise		/* 205 */ | 
 | 1161 | 	.llong .sys_mincore | 
 | 1162 | 	.llong .sys_gettid | 
 | 1163 | 	.llong .sys_tkill | 
 | 1164 | 	.llong .sys_setxattr | 
 | 1165 | 	.llong .sys_lsetxattr		/* 210 */ | 
 | 1166 | 	.llong .sys_fsetxattr | 
 | 1167 | 	.llong .sys_getxattr | 
 | 1168 | 	.llong .sys_lgetxattr | 
 | 1169 | 	.llong .sys_fgetxattr | 
 | 1170 | 	.llong .sys_listxattr		/* 215 */ | 
 | 1171 | 	.llong .sys_llistxattr | 
 | 1172 | 	.llong .sys_flistxattr | 
 | 1173 | 	.llong .sys_removexattr | 
 | 1174 | 	.llong .sys_lremovexattr | 
 | 1175 | 	.llong .sys_fremovexattr	/* 220 */ | 
 | 1176 | 	.llong .compat_sys_futex | 
 | 1177 | 	.llong .compat_sys_sched_setaffinity | 
 | 1178 | 	.llong .compat_sys_sched_getaffinity | 
 | 1179 | 	.llong .sys_ni_syscall | 
 | 1180 | 	.llong .sys_ni_syscall		/* 225 - reserved for tux */ | 
 | 1181 | 	.llong .sys32_sendfile64 | 
 | 1182 | 	.llong .compat_sys_io_setup | 
 | 1183 | 	.llong .sys_io_destroy | 
 | 1184 | 	.llong .compat_sys_io_getevents | 
 | 1185 | 	.llong .compat_sys_io_submit | 
 | 1186 | 	.llong .sys_io_cancel | 
 | 1187 | 	.llong .sys_set_tid_address | 
 | 1188 | 	.llong .ppc32_fadvise64 | 
 | 1189 | 	.llong .sys_exit_group | 
 | 1190 | 	.llong .ppc32_lookup_dcookie	/* 235 */ | 
 | 1191 | 	.llong .sys_epoll_create | 
 | 1192 | 	.llong .sys_epoll_ctl | 
 | 1193 | 	.llong .sys_epoll_wait | 
 | 1194 | 	.llong .sys_remap_file_pages | 
 | 1195 | 	.llong .ppc32_timer_create	/* 240 */ | 
 | 1196 | 	.llong .compat_sys_timer_settime | 
 | 1197 | 	.llong .compat_sys_timer_gettime | 
 | 1198 | 	.llong .sys_timer_getoverrun | 
 | 1199 | 	.llong .sys_timer_delete | 
 | 1200 | 	.llong .compat_sys_clock_settime	/* 245 */ | 
 | 1201 | 	.llong .compat_sys_clock_gettime | 
 | 1202 | 	.llong .compat_sys_clock_getres | 
 | 1203 | 	.llong .compat_sys_clock_nanosleep | 
 | 1204 | 	.llong .ppc32_swapcontext | 
 | 1205 | 	.llong .sys32_tgkill		/* 250 */ | 
 | 1206 | 	.llong .sys32_utimes | 
 | 1207 | 	.llong .compat_sys_statfs64 | 
 | 1208 | 	.llong .compat_sys_fstatfs64 | 
 | 1209 | 	.llong .ppc32_fadvise64_64	/* 32bit only fadvise64_64 */ | 
 | 1210 | 	.llong .ppc_rtas		/* 255 */ | 
 | 1211 | 	.llong .sys_ni_syscall		/* 256 reserved for sys_debug_setcontext */ | 
 | 1212 | 	.llong .sys_ni_syscall		/* 257 reserved for vserver */ | 
 | 1213 | 	.llong .sys_ni_syscall		/* 258 reserved for new sys_remap_file_pages */ | 
 | 1214 | 	.llong .compat_sys_mbind | 
 | 1215 | 	.llong .compat_sys_get_mempolicy	/* 260 */ | 
 | 1216 | 	.llong .compat_sys_set_mempolicy | 
 | 1217 | 	.llong .compat_sys_mq_open | 
 | 1218 | 	.llong .sys_mq_unlink | 
 | 1219 | 	.llong .compat_sys_mq_timedsend | 
 | 1220 | 	.llong .compat_sys_mq_timedreceive /* 265 */ | 
 | 1221 | 	.llong .compat_sys_mq_notify | 
 | 1222 | 	.llong .compat_sys_mq_getsetattr | 
| R Sharada | fce0d57 | 2005-06-25 14:58:10 -0700 | [diff] [blame] | 1223 | 	.llong .compat_sys_kexec_load | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1224 | 	.llong .sys32_add_key | 
| Anton Blanchard | 79c2cc7 | 2005-07-07 17:56:15 -0700 | [diff] [blame] | 1225 | 	.llong .sys32_request_key	/* 270 */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1226 | 	.llong .compat_sys_keyctl | 
 | 1227 | 	.llong .compat_sys_waitid | 
| Anton Blanchard | 79c2cc7 | 2005-07-07 17:56:15 -0700 | [diff] [blame] | 1228 | 	.llong .sys32_ioprio_set | 
 | 1229 | 	.llong .sys32_ioprio_get | 
| Robert Love | 5fa918b | 2005-07-29 22:59:17 -0700 | [diff] [blame] | 1230 | 	.llong .sys_inotify_init	/* 275 */ | 
 | 1231 | 	.llong .sys_inotify_add_watch | 
 | 1232 | 	.llong .sys_inotify_rm_watch | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1233 |  | 
 | 1234 | 	.balign 8 | 
 | 1235 | _GLOBAL(sys_call_table) | 
 | 1236 | 	.llong .sys_restart_syscall	/* 0 */ | 
 | 1237 | 	.llong .sys_exit | 
 | 1238 | 	.llong .ppc_fork | 
 | 1239 | 	.llong .sys_read | 
 | 1240 | 	.llong .sys_write | 
 | 1241 | 	.llong .sys_open		/* 5 */ | 
 | 1242 | 	.llong .sys_close | 
 | 1243 | 	.llong .sys_waitpid | 
 | 1244 | 	.llong .sys_creat | 
 | 1245 | 	.llong .sys_link | 
 | 1246 | 	.llong .sys_unlink		/* 10 */ | 
 | 1247 | 	.llong .sys_execve | 
 | 1248 | 	.llong .sys_chdir | 
 | 1249 | 	.llong .sys64_time | 
 | 1250 | 	.llong .sys_mknod | 
 | 1251 | 	.llong .sys_chmod		/* 15 */ | 
 | 1252 | 	.llong .sys_lchown | 
 | 1253 | 	.llong .sys_ni_syscall		/* old break syscall */ | 
 | 1254 | 	.llong .sys_ni_syscall		/* old stat syscall */ | 
 | 1255 | 	.llong .sys_lseek | 
 | 1256 | 	.llong .sys_getpid		/* 20 */ | 
 | 1257 | 	.llong .sys_mount | 
 | 1258 | 	.llong .sys_ni_syscall		/* old umount syscall */ | 
 | 1259 | 	.llong .sys_setuid | 
 | 1260 | 	.llong .sys_getuid | 
 | 1261 | 	.llong .sys_stime		/* 25 */ | 
 | 1262 | 	.llong .sys_ptrace | 
 | 1263 | 	.llong .sys_alarm | 
 | 1264 | 	.llong .sys_ni_syscall		/* old fstat syscall */ | 
 | 1265 | 	.llong .sys_pause | 
 | 1266 | 	.llong .sys_utime		/* 30 */ | 
 | 1267 | 	.llong .sys_ni_syscall		/* old stty syscall */ | 
 | 1268 | 	.llong .sys_ni_syscall		/* old gtty syscall */ | 
 | 1269 | 	.llong .sys_access | 
 | 1270 | 	.llong .sys_nice | 
 | 1271 | 	.llong .sys_ni_syscall		/* 35 - old ftime syscall */ | 
 | 1272 | 	.llong .sys_sync | 
 | 1273 | 	.llong .sys_kill | 
 | 1274 | 	.llong .sys_rename | 
 | 1275 | 	.llong .sys_mkdir | 
 | 1276 | 	.llong .sys_rmdir		/* 40 */ | 
 | 1277 | 	.llong .sys_dup | 
 | 1278 | 	.llong .sys_pipe | 
 | 1279 | 	.llong .sys_times | 
 | 1280 | 	.llong .sys_ni_syscall		/* old prof syscall */ | 
 | 1281 | 	.llong .sys_brk			/* 45 */ | 
 | 1282 | 	.llong .sys_setgid | 
 | 1283 | 	.llong .sys_getgid | 
 | 1284 | 	.llong .sys_signal | 
 | 1285 | 	.llong .sys_geteuid | 
 | 1286 | 	.llong .sys_getegid		/* 50 */ | 
 | 1287 | 	.llong .sys_acct | 
 | 1288 | 	.llong .sys_umount | 
 | 1289 | 	.llong .sys_ni_syscall		/* old lock syscall */ | 
 | 1290 | 	.llong .sys_ioctl | 
 | 1291 | 	.llong .sys_fcntl		/* 55 */ | 
 | 1292 | 	.llong .sys_ni_syscall		/* old mpx syscall */ | 
 | 1293 | 	.llong .sys_setpgid | 
 | 1294 | 	.llong .sys_ni_syscall		/* old ulimit syscall */ | 
 | 1295 | 	.llong .sys_ni_syscall		/* old uname syscall */ | 
 | 1296 | 	.llong .sys_umask		/* 60 */ | 
 | 1297 | 	.llong .sys_chroot | 
 | 1298 | 	.llong .sys_ustat | 
 | 1299 | 	.llong .sys_dup2 | 
 | 1300 | 	.llong .sys_getppid | 
 | 1301 | 	.llong .sys_getpgrp		/* 65 */ | 
 | 1302 | 	.llong .sys_setsid | 
 | 1303 | 	.llong .sys_ni_syscall | 
 | 1304 | 	.llong .sys_sgetmask | 
 | 1305 | 	.llong .sys_ssetmask | 
 | 1306 | 	.llong .sys_setreuid		/* 70 */ | 
 | 1307 | 	.llong .sys_setregid | 
 | 1308 | 	.llong .sys_ni_syscall | 
 | 1309 | 	.llong .sys_ni_syscall | 
 | 1310 | 	.llong .sys_sethostname | 
 | 1311 | 	.llong .sys_setrlimit		/* 75 */ | 
 | 1312 | 	.llong .sys_ni_syscall		/* old getrlimit syscall */ | 
 | 1313 | 	.llong .sys_getrusage | 
 | 1314 | 	.llong .sys_gettimeofday | 
 | 1315 | 	.llong .sys_settimeofday | 
 | 1316 | 	.llong .sys_getgroups		/* 80 */ | 
 | 1317 | 	.llong .sys_setgroups | 
 | 1318 | 	.llong .sys_ni_syscall		/* old select syscall */ | 
 | 1319 | 	.llong .sys_symlink | 
 | 1320 | 	.llong .sys_ni_syscall		/* old lstat syscall */ | 
 | 1321 | 	.llong .sys_readlink		/* 85 */ | 
 | 1322 | 	.llong .sys_uselib | 
 | 1323 | 	.llong .sys_swapon | 
 | 1324 | 	.llong .sys_reboot | 
 | 1325 | 	.llong .sys_ni_syscall		/* old readdir syscall */ | 
 | 1326 | 	.llong .sys_mmap		/* 90 */ | 
 | 1327 | 	.llong .sys_munmap | 
 | 1328 | 	.llong .sys_truncate | 
 | 1329 | 	.llong .sys_ftruncate | 
 | 1330 | 	.llong .sys_fchmod | 
 | 1331 | 	.llong .sys_fchown		/* 95 */ | 
 | 1332 | 	.llong .sys_getpriority | 
 | 1333 | 	.llong .sys_setpriority | 
 | 1334 | 	.llong .sys_ni_syscall		/* old profil syscall holder */ | 
 | 1335 | 	.llong .sys_statfs | 
 | 1336 | 	.llong .sys_fstatfs		/* 100 */ | 
 | 1337 | 	.llong .sys_ni_syscall		/* old ioperm syscall */ | 
 | 1338 | 	.llong .sys_socketcall | 
 | 1339 | 	.llong .sys_syslog | 
 | 1340 | 	.llong .sys_setitimer | 
 | 1341 | 	.llong .sys_getitimer		/* 105 */ | 
 | 1342 | 	.llong .sys_newstat | 
 | 1343 | 	.llong .sys_newlstat | 
 | 1344 | 	.llong .sys_newfstat | 
 | 1345 | 	.llong .sys_ni_syscall		/* old uname syscall */ | 
 | 1346 | 	.llong .sys_ni_syscall		/* 110 old iopl syscall */ | 
 | 1347 | 	.llong .sys_vhangup | 
 | 1348 | 	.llong .sys_ni_syscall		/* old idle syscall */ | 
 | 1349 | 	.llong .sys_ni_syscall		/* old vm86 syscall */ | 
 | 1350 | 	.llong .sys_wait4 | 
 | 1351 | 	.llong .sys_swapoff		/* 115 */ | 
 | 1352 | 	.llong .sys_sysinfo | 
 | 1353 | 	.llong .sys_ipc | 
 | 1354 | 	.llong .sys_fsync | 
 | 1355 | 	.llong .sys_ni_syscall | 
 | 1356 | 	.llong .ppc_clone		/* 120 */ | 
 | 1357 | 	.llong .sys_setdomainname | 
 | 1358 | 	.llong .ppc64_newuname | 
 | 1359 | 	.llong .sys_ni_syscall		/* old modify_ldt syscall */ | 
 | 1360 | 	.llong .sys_adjtimex | 
 | 1361 | 	.llong .sys_mprotect		/* 125 */ | 
 | 1362 | 	.llong .sys_ni_syscall | 
 | 1363 | 	.llong .sys_ni_syscall		/* old create_module syscall */ | 
 | 1364 | 	.llong .sys_init_module | 
 | 1365 | 	.llong .sys_delete_module | 
 | 1366 | 	.llong .sys_ni_syscall		/* 130 old get_kernel_syms syscall */ | 
 | 1367 | 	.llong .sys_quotactl | 
 | 1368 | 	.llong .sys_getpgid | 
 | 1369 | 	.llong .sys_fchdir | 
 | 1370 | 	.llong .sys_bdflush | 
 | 1371 | 	.llong .sys_sysfs		/* 135 */ | 
 | 1372 | 	.llong .ppc64_personality | 
 | 1373 | 	.llong .sys_ni_syscall	        /* for afs_syscall */ | 
 | 1374 | 	.llong .sys_setfsuid | 
 | 1375 | 	.llong .sys_setfsgid | 
 | 1376 | 	.llong .sys_llseek	        /* 140 */ | 
 | 1377 |         .llong .sys_getdents | 
 | 1378 | 	.llong .sys_select | 
 | 1379 | 	.llong .sys_flock | 
 | 1380 | 	.llong .sys_msync | 
 | 1381 | 	.llong .sys_readv		/* 145 */ | 
 | 1382 | 	.llong .sys_writev | 
 | 1383 | 	.llong .sys_getsid | 
 | 1384 | 	.llong .sys_fdatasync | 
 | 1385 | 	.llong .sys_sysctl | 
 | 1386 | 	.llong .sys_mlock		/* 150 */ | 
 | 1387 | 	.llong .sys_munlock | 
 | 1388 | 	.llong .sys_mlockall | 
 | 1389 | 	.llong .sys_munlockall | 
 | 1390 | 	.llong .sys_sched_setparam | 
 | 1391 | 	.llong .sys_sched_getparam	/* 155 */ | 
 | 1392 | 	.llong .sys_sched_setscheduler | 
 | 1393 | 	.llong .sys_sched_getscheduler | 
 | 1394 | 	.llong .sys_sched_yield | 
 | 1395 | 	.llong .sys_sched_get_priority_max | 
 | 1396 | 	.llong .sys_sched_get_priority_min  /* 160 */ | 
 | 1397 | 	.llong .sys_sched_rr_get_interval | 
 | 1398 | 	.llong .sys_nanosleep | 
 | 1399 | 	.llong .sys_mremap | 
 | 1400 | 	.llong .sys_setresuid | 
 | 1401 | 	.llong .sys_getresuid	        /* 165 */ | 
 | 1402 | 	.llong .sys_ni_syscall		/* old query_module syscall */ | 
 | 1403 | 	.llong .sys_poll | 
 | 1404 | 	.llong .sys_nfsservctl | 
 | 1405 | 	.llong .sys_setresgid | 
 | 1406 | 	.llong .sys_getresgid	        /* 170 */ | 
 | 1407 | 	.llong .sys_prctl | 
 | 1408 | 	.llong .ppc64_rt_sigreturn | 
 | 1409 | 	.llong .sys_rt_sigaction | 
 | 1410 | 	.llong .sys_rt_sigprocmask	 | 
 | 1411 | 	.llong .sys_rt_sigpending	/* 175 */ | 
 | 1412 | 	.llong .sys_rt_sigtimedwait | 
 | 1413 | 	.llong .sys_rt_sigqueueinfo | 
 | 1414 | 	.llong .ppc64_rt_sigsuspend | 
 | 1415 | 	.llong .sys_pread64 | 
 | 1416 | 	.llong .sys_pwrite64	        /* 180 */ | 
 | 1417 | 	.llong .sys_chown | 
 | 1418 | 	.llong .sys_getcwd | 
 | 1419 | 	.llong .sys_capget | 
 | 1420 | 	.llong .sys_capset | 
 | 1421 | 	.llong .sys_sigaltstack	        /* 185 */ | 
 | 1422 | 	.llong .sys_sendfile64 | 
 | 1423 | 	.llong .sys_ni_syscall		/* reserved for streams1 */ | 
 | 1424 | 	.llong .sys_ni_syscall		/* reserved for streams2 */ | 
 | 1425 | 	.llong .ppc_vfork | 
 | 1426 | 	.llong .sys_getrlimit	        /* 190 */ | 
 | 1427 | 	.llong .sys_readahead | 
 | 1428 | 	.llong .sys_ni_syscall		/* 32bit only mmap2 */ | 
 | 1429 | 	.llong .sys_ni_syscall		/* 32bit only truncate64 */ | 
 | 1430 | 	.llong .sys_ni_syscall		/* 32bit only ftruncate64 */ | 
 | 1431 | 	.llong .sys_ni_syscall		/* 195 - 32bit only stat64 */ | 
 | 1432 | 	.llong .sys_ni_syscall		/* 32bit only lstat64 */ | 
 | 1433 | 	.llong .sys_ni_syscall		/* 32bit only fstat64 */ | 
 | 1434 | 	.llong .sys_ni_syscall		/* 32bit only pciconfig_read */ | 
 | 1435 | 	.llong .sys_ni_syscall		/* 32bit only pciconfig_write */ | 
 | 1436 | 	.llong .sys_ni_syscall		/* 32bit only pciconfig_iobase */ | 
 | 1437 | 	.llong .sys_ni_syscall		/* reserved for MacOnLinux */ | 
 | 1438 | 	.llong .sys_getdents64 | 
 | 1439 | 	.llong .sys_pivot_root | 
 | 1440 | 	.llong .sys_ni_syscall		/* 32bit only fcntl64 */ | 
 | 1441 | 	.llong .sys_madvise		/* 205 */ | 
 | 1442 | 	.llong .sys_mincore | 
 | 1443 | 	.llong .sys_gettid | 
 | 1444 | 	.llong .sys_tkill | 
 | 1445 | 	.llong .sys_setxattr | 
 | 1446 | 	.llong .sys_lsetxattr		/* 210 */ | 
 | 1447 | 	.llong .sys_fsetxattr | 
 | 1448 | 	.llong .sys_getxattr | 
 | 1449 | 	.llong .sys_lgetxattr | 
 | 1450 | 	.llong .sys_fgetxattr | 
 | 1451 | 	.llong .sys_listxattr		/* 215 */ | 
 | 1452 | 	.llong .sys_llistxattr | 
 | 1453 | 	.llong .sys_flistxattr | 
 | 1454 | 	.llong .sys_removexattr | 
 | 1455 | 	.llong .sys_lremovexattr | 
 | 1456 | 	.llong .sys_fremovexattr	/* 220 */ | 
 | 1457 | 	.llong .sys_futex | 
 | 1458 | 	.llong .sys_sched_setaffinity | 
 | 1459 | 	.llong .sys_sched_getaffinity | 
 | 1460 | 	.llong .sys_ni_syscall | 
 | 1461 | 	.llong .sys_ni_syscall		/* 225 - reserved for tux */ | 
 | 1462 | 	.llong .sys_ni_syscall		/* 32bit only sendfile64 */ | 
 | 1463 | 	.llong .sys_io_setup | 
 | 1464 | 	.llong .sys_io_destroy | 
 | 1465 | 	.llong .sys_io_getevents | 
 | 1466 | 	.llong .sys_io_submit		/* 230 */ | 
 | 1467 | 	.llong .sys_io_cancel | 
 | 1468 | 	.llong .sys_set_tid_address | 
 | 1469 | 	.llong .sys_fadvise64 | 
 | 1470 | 	.llong .sys_exit_group | 
 | 1471 | 	.llong .sys_lookup_dcookie	/* 235 */ | 
 | 1472 | 	.llong .sys_epoll_create | 
 | 1473 | 	.llong .sys_epoll_ctl | 
 | 1474 | 	.llong .sys_epoll_wait | 
 | 1475 | 	.llong .sys_remap_file_pages | 
 | 1476 | 	.llong .sys_timer_create	/* 240 */ | 
 | 1477 | 	.llong .sys_timer_settime | 
 | 1478 | 	.llong .sys_timer_gettime | 
 | 1479 | 	.llong .sys_timer_getoverrun | 
 | 1480 | 	.llong .sys_timer_delete | 
 | 1481 | 	.llong .sys_clock_settime	/* 245 */ | 
 | 1482 | 	.llong .sys_clock_gettime | 
 | 1483 | 	.llong .sys_clock_getres | 
 | 1484 | 	.llong .sys_clock_nanosleep | 
 | 1485 | 	.llong .ppc64_swapcontext | 
 | 1486 | 	.llong .sys_tgkill		/* 250 */ | 
 | 1487 | 	.llong .sys_utimes | 
 | 1488 | 	.llong .sys_statfs64 | 
 | 1489 | 	.llong .sys_fstatfs64 | 
 | 1490 | 	.llong .sys_ni_syscall		/* 32bit only fadvise64_64 */ | 
 | 1491 | 	.llong .ppc_rtas		/* 255 */ | 
 | 1492 | 	.llong .sys_ni_syscall		/* 256 reserved for sys_debug_setcontext */ | 
 | 1493 | 	.llong .sys_ni_syscall		/* 257 reserved for vserver */ | 
 | 1494 | 	.llong .sys_ni_syscall		/* 258 reserved for new sys_remap_file_pages */ | 
 | 1495 | 	.llong .sys_mbind | 
 | 1496 | 	.llong .sys_get_mempolicy	/* 260 */ | 
 | 1497 | 	.llong .sys_set_mempolicy | 
 | 1498 | 	.llong .sys_mq_open | 
 | 1499 | 	.llong .sys_mq_unlink | 
 | 1500 | 	.llong .sys_mq_timedsend | 
 | 1501 | 	.llong .sys_mq_timedreceive	/* 265 */ | 
 | 1502 | 	.llong .sys_mq_notify | 
 | 1503 | 	.llong .sys_mq_getsetattr | 
| R Sharada | fce0d57 | 2005-06-25 14:58:10 -0700 | [diff] [blame] | 1504 | 	.llong .sys_kexec_load | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1505 | 	.llong .sys_add_key | 
 | 1506 | 	.llong .sys_request_key		/* 270 */ | 
 | 1507 | 	.llong .sys_keyctl | 
 | 1508 | 	.llong .sys_waitid | 
| Anton Blanchard | 79c2cc7 | 2005-07-07 17:56:15 -0700 | [diff] [blame] | 1509 | 	.llong .sys_ioprio_set | 
 | 1510 | 	.llong .sys_ioprio_get | 
| Robert Love | 5fa918b | 2005-07-29 22:59:17 -0700 | [diff] [blame] | 1511 | 	.llong .sys_inotify_init	/* 275 */ | 
 | 1512 | 	.llong .sys_inotify_add_watch | 
 | 1513 | 	.llong .sys_inotify_rm_watch |