00001 00007 /* Embedded XINU, Copyright (C) 2007. All rights reserved. */ 00008 00009 #include <kernel.h> 00010 #include <device.h> 00011 #include <tty.h> 00012 #include <stdlib.h> 00013 00019 devcall ttyClose(device *pdev) 00020 { 00021 struct tty *ptty; 00022 00023 ptty = (struct tty *)pdev->controlblk; 00024 00025 ASSERT(NULL != ptty); 00026 00027 bzero(ptty, sizeof(struct tty)); /* Clear TTY structure. */ 00028 00029 pdev->controlblk = (char *)NULL; /* Clear device IO block. */ 00030 ptty->state = TTY_STATE_FREE; 00031 return OK; 00032 }