cregit-Linux how code gets into the kernel

Release 4.14 arch/mips/jazz/reset.c

Directory: arch/mips/jazz
// SPDX-License-Identifier: GPL-2.0
/*
 * Reset a Jazz machine.
 *
 * We don't trust the firmware so we do it the classic way by poking and
 * stabbing at the keyboard controller ...
 */
#include <linux/jiffies.h>
#include <asm/jazz.h>


#define KBD_STAT_IBF		0x02	
/* Keyboard input buffer full */


static void jazz_write_output(unsigned char val) { int status; do { status = jazz_kh->command; } while (status & KBD_STAT_IBF); jazz_kh->data = val; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton35100.00%1100.00%
Total35100.00%1100.00%


static void jazz_write_command(unsigned char val) { int status; do { status = jazz_kh->command; } while (status & KBD_STAT_IBF); jazz_kh->command = val; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton35100.00%1100.00%
Total35100.00%1100.00%


static unsigned char jazz_read_status(void) { return jazz_kh->command; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton14100.00%1100.00%
Total14100.00%1100.00%


static inline void kb_wait(void) { unsigned long start = jiffies; unsigned long timeout = start + HZ/2; do { if (! (jazz_read_status() & 0x02)) return; } while (time_before_eq(jiffies, timeout)); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)2755.10%133.33%
Andrew Morton1224.49%133.33%
Ralf Bächle1020.41%133.33%
Total49100.00%3100.00%


void jazz_machine_restart(char *command) { while(1) { kb_wait(); jazz_write_command(0xd1); kb_wait(); jazz_write_output(0x00); } }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)2374.19%266.67%
Andrew Morton825.81%133.33%
Total31100.00%3100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton11062.15%116.67%
Linus Torvalds (pre-git)5531.07%233.33%
Ralf Bächle105.65%116.67%
Greg Kroah-Hartman10.56%116.67%
Rusty Russell10.56%116.67%
Total177100.00%6100.00%
Directory: arch/mips/jazz
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.