2007-11-05 Robert Millan <rmh@aybabtu.com>

* disk/ata.c: Remove `<grub/machine/time.h>'.  Include `<grub/time.h>'.
	(grub_ata_wait): Reimplement using grub_millisleep().

	* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
	* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
This commit is contained in:
robertmh 2007-11-05 14:54:00 +00:00
parent be7ac41e14
commit 0149ab7c63
5 changed files with 14 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2007-11-05 Robert Millan <rmh@aybabtu.com>
* disk/ata.c: Remove `<grub/machine/time.h>'. Include `<grub/time.h>'.
(grub_ata_wait): Reimplement using grub_millisleep().
* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
2007-11-03 Marco Gerards <marco@gnu.org> 2007-11-03 Marco Gerards <marco@gnu.org>
* term/i386/pc/vga_text.c: Include <grub/cpu/io.h>. * term/i386/pc/vga_text.c: Include <grub/cpu/io.h>.

View file

@ -21,9 +21,9 @@
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/disk.h> #include <grub/disk.h>
#include <grub/mm.h> #include <grub/mm.h>
#include <grub/time.h>
/* XXX: For now this only works on i386. */ /* XXX: For now this only works on i386. */
#include <grub/cpu/io.h> #include <grub/cpu/io.h>
#include <grub/machine/time.h>
#include <grub/machine/biosdisk.h> #include <grub/machine/biosdisk.h>
typedef enum typedef enum
@ -142,10 +142,7 @@ grub_ata_wait_drq (struct grub_ata_device *dev)
static inline void static inline void
grub_ata_wait (void) grub_ata_wait (void)
{ {
grub_uint32_t time; grub_millisleep (50);
time = grub_get_rtc ();
while (time + 1 > grub_get_rtc ());
} }
/* Byteorder has to be changed before strings can be read. */ /* Byteorder has to be changed before strings can be read. */

View file

@ -22,7 +22,8 @@
static __inline void static __inline void
grub_cpu_idle () grub_cpu_idle ()
{ {
__asm__ __volatile__ ("hlt"); /* FIXME: this can't work untill we handle interrupts. */
/* __asm__ __volatile__ ("hlt"); */
} }
#endif /* ! KERNEL_CPU_TIME_HEADER */ #endif /* ! KERNEL_CPU_TIME_HEADER */

View file

@ -106,7 +106,7 @@ grub_max (long x, long y)
static inline unsigned int static inline unsigned int
grub_div_roundup (unsigned int x, unsigned int y) grub_div_roundup (unsigned int x, unsigned int y)
{ {
return (x + (y - 1) / y); return (x + y - 1) / y;
} }
#endif /* ! GRUB_MISC_HEADER */ #endif /* ! GRUB_MISC_HEADER */