]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
merge mainline into net
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 15 Dec 2011 19:51:35 +0000 (20:51 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 15 Dec 2011 19:51:35 +0000 (20:51 +0100)
1  2 
grub-core/Makefile.core.def
grub-core/lib/legacy_parse.c
grub-core/net/bootp.c
grub-core/net/drivers/ieee1275/ofnet.c
grub-core/net/net.c
grub-core/net/netbuff.c
include/grub/efi/api.h
include/grub/misc.h
include/grub/net.h
include/grub/types.h

Simple merge
Simple merge
index b83b343c8c032c848b23fa68aa10fe45084ec010,ba6a2902031f6af216cc20ea77ec31ae14372146..f84d4ff66b0e940c0acba6d27a8209621a19ee01
@@@ -547,8 -520,11 +547,8 @@@ voi
  grub_bootp_init (void)
  {
    cmd_bootp = grub_register_command ("net_bootp", grub_cmd_bootp,
-                                    "[CARD]",
+                                    N_("[CARD]"),
                                     N_("perform a bootp autoconfiguration"));
 -  cmd_dhcp = grub_register_command ("net_dhcp", grub_cmd_bootp,
 -                                  N_("[CARD]"),
 -                                   N_("perform a bootp autoconfiguration"));
    cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt,
                                       N_("VAR INTERFACE NUMBER DESCRIPTION"),
                                       N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value."));
index 269786fd8614f1981816584e63c72f52ec1f447c,d4e445e7107ad06e52268f3864aaca48b7b2d6de..ed6229807971aaaece29e602557ed512290a4c70
@@@ -1468,21 -946,16 +1468,21 @@@ static grub_command_t cmd_lsaddr, cmd_s
  GRUB_MOD_INIT(net)
  {
    cmd_addaddr = grub_register_command ("net_add_addr", grub_cmd_addaddr,
-                                      "SHORTNAME CARD ADDRESS [HWADDRESS]",
+                                      N_("SHORTNAME CARD ADDRESS [HWADDRESS]"),
                                       N_("Add a network address."));
 +  cmd_slaac = grub_register_command ("net_ipv6_autoconf",
 +                                   grub_cmd_ipv6_autoconf,
 +                                   "[CARD [HWADDRESS]]",
 +                                   N_("Perform an IPV6 autoconfiguration"));
 +
    cmd_deladdr = grub_register_command ("net_del_addr", grub_cmd_deladdr,
-                                      "SHORTNAME",
+                                      N_("SHORTNAME"),
                                       N_("Delete a network address."));
    cmd_addroute = grub_register_command ("net_add_route", grub_cmd_addroute,
-                                       "SHORTNAME NET [INTERFACE| gw GATEWAY]",
+                                       N_("SHORTNAME NET [INTERFACE| gw GATEWAY]"),
                                        N_("Add a network route."));
    cmd_delroute = grub_register_command ("net_del_route", grub_cmd_delroute,
-                                       "SHORTNAME",
+                                       N_("SHORTNAME"),
                                        N_("Delete a network route."));
    cmd_lsroutes = grub_register_command ("net_ls_routes", grub_cmd_listroutes,
                                        "", N_("list network routes"));
index cb6106fc76064025a0e4f58064a693082624ef2a,bee207f90eadac2b7f15555d2c622ac02fa6d590..242b154e0198d0cc32eb970b76ec11010cdf3e08
@@@ -84,9 -87,10 +86,10 @@@ grub_netbuff_alloc (grub_size_t len
    data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb));
    if (!data)
      return NULL;
-   nb = (struct grub_net_buff *) ((grub_uint8_t *) data + len);
+   nb = (struct grub_net_buff *) ((grub_properly_aligned_t *) data
+                                + len / sizeof (grub_properly_aligned_t));
    nb->head = nb->data = nb->tail = data;
 -  nb->end = (char *) nb;
 +  nb->end = (grub_uint8_t *) nb;
    return nb;
  }
  
Simple merge
Simple merge
Simple merge
index 68f28d01d8500f63bfead58f1a5a2c9138f14f67,f8059c1abca68f593de956966d50bf0e77fc18f2..89c1697d22333ecdfe2e1cefd3aba2c488063c7f
@@@ -116,9 -114,12 +116,13 @@@ typedef grub_int32_t     grub_ssize_t
  # define PRIxGRUB_SIZE        "x"
  # define PRIxGRUB_ADDR        "x"
  # define PRIuGRUB_SIZE        "u"
 +# define PRIdGRUB_SSIZE       "d"
  #endif
  
+ #define GRUB_UCHAR_MAX 0xFF
+ #define GRUB_USHRT_MAX 65535
+ #define GRUB_UINT_MAX 4294967295U
  #if GRUB_CPU_SIZEOF_LONG == 8
  # define GRUB_ULONG_MAX 18446744073709551615UL
  # define GRUB_LONG_MAX 9223372036854775807L
@@@ -233,13 -212,61 +231,66 @@@ static inline grub_uint64_t grub_swap_b
  # define grub_be_to_cpu16(x)  grub_swap_bytes16(x)
  # define grub_be_to_cpu32(x)  grub_swap_bytes32(x)
  # define grub_be_to_cpu64(x)  grub_swap_bytes64(x)
 +# define grub_cpu_to_be16_compile_time(x)     grub_swap_bytes16_compile_time(x)
 +# define grub_cpu_to_be32_compile_time(x)     grub_swap_bytes32_compile_time(x)
 +# define grub_cpu_to_be64_compile_time(x)     grub_swap_bytes64_compile_time(x)
 +# define grub_be_to_cpu64_compile_time(x)     grub_swap_bytes64_compile_time(x)
  # define grub_cpu_to_le16_compile_time(x)     ((grub_uint16_t) (x))
  # define grub_cpu_to_le32_compile_time(x)     ((grub_uint32_t) (x))
 +
  #endif /* ! WORDS_BIGENDIAN */
  
+ static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
+ {
+   struct grub_unaligned_uint16_t
+   {
+     grub_uint16_t d;
+   } __attribute__ ((packed));
+   const struct grub_unaligned_uint16_t *dd
+     = (const struct grub_unaligned_uint16_t *) ptr;
+   return dd->d;
+ }
+ static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
+ {
+   struct grub_unaligned_uint16_t
+   {
+     grub_uint16_t d;
+   } __attribute__ ((packed));
+   struct grub_unaligned_uint16_t *dd = (struct grub_unaligned_uint16_t *) ptr;
+   dd->d = val;
+ }
+ static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
+ {
+   struct grub_unaligned_uint32_t
+   {
+     grub_uint32_t d;
+   } __attribute__ ((packed));
+   const struct grub_unaligned_uint32_t *dd
+     = (const struct grub_unaligned_uint32_t *) ptr;
+   return dd->d;
+ }
+ static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
+ {
+   struct grub_unaligned_uint32_t
+   {
+     grub_uint32_t d;
+   } __attribute__ ((packed));
+   struct grub_unaligned_uint32_t *dd = (struct grub_unaligned_uint32_t *) ptr;
+   dd->d = val;
+ }
+ static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
+ {
+   struct grub_unaligned_uint64_t
+   {
+     grub_uint64_t d;
+   } __attribute__ ((packed));
+   const struct grub_unaligned_uint64_t *dd
+     = (const struct grub_unaligned_uint64_t *)ptr;
+   return dd->d;
+ }
  #endif /* ! GRUB_TYPES_HEADER */