aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-11-29 02:26:49 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-11-29 02:26:49 +0000
commit14657de8f1fd8fff5cb3bed37d91267beea5e1f3 (patch)
tree0cd978ce53551cb7dfa9d8927ebebee6a99623a6 /libjava
parent146e60a0704290a2dcac78ffb1a2efbd7b852f7e (diff)
downloadgcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.zip
gcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.tar.gz
gcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.tar.bz2
com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses.
* com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses. (ffecom_char_enhance_arg_, ffecom_do_entry_, ffecom_f2c_make_type_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_start_progunit_, ffecom_start_progunit_, ffecom_sym_transform_assign_, ffecom_transform_equiv_, ffecom_transform_namelist_, ffecom_vardesc_, ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_end_transition, ffecom_lookup_label, ffecom_temp_label): Adjust accordingly. * com.h (ffecom_get_invented_identifier): Likewise. * sts.c (ffests_printf): New function taking ellipses. (ffests_printf_1D, ffests_printf_1U, ffests_printf_1s, ffests_printf_2Us): Delete. * sts.h: Likewise. * std.c (ffestd_R1001dump_, ffestd_R1001dump_1005_1_, ffestd_R1001dump_1005_2_, ffestd_R1001dump_1005_3_, ffestd_R1001dump_1005_4_, ffestd_R1001dump_1005_5_, ffestd_R1001dump_1010_2_, ffestd_R1001dump_1010_3_, ffestd_R1001dump_1010_4_, ffestd_R1001dump_1010_5_, ffestd_R1001rtexpr_): Call `ffests_printf', not `ffests_printf_*'. * ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_, ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_): Likewise. From-SVN: r30692
Diffstat (limited to 'libjava')
0 files changed, 0 insertions, 0 deletions
/*
 * Copyright (C) 2021 Michael Brown <mbrown@fensystems.co.uk>.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 *
 * You can also choose to distribute this program under the terms of
 * the Unmodified Binary Distribution Licence (as given in the file
 * COPYING.UBDL), provided that you have satisfied its requirements.
 */

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );

#include <string.h>
#include <errno.h>
#include <ipxe/cachedhcp.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_cachedhcp.h>
#include <ipxe/efi/Protocol/PxeBaseCode.h>

/** @file
 *
 * EFI cached DHCP packet
 *
 */

/**
 * Record cached DHCP packet
 *
 * @v device		Device handle
 * @ret rc		Return status code
 */
int efi_cachedhcp_record ( EFI_HANDLE device ) {
		EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
	union {
		EFI_PXE_BASE_CODE_PROTOCOL *pxe;
		void *interface;
	} pxe;
	EFI_PXE_BASE_CODE_MODE *mode;
	EFI_STATUS efirc;
	int rc;

	/* Look for a PXE base code instance on the image's device handle */
	if ( ( efirc = bs->OpenProtocol ( device,
					  &efi_pxe_base_code_protocol_guid,
					  &pxe.interface, efi_image_handle,
					  NULL,
					  EFI_OPEN_PROTOCOL_GET_PROTOCOL ))!=0){
		rc = -EEFI ( efirc );
		DBGC ( device, "EFI %s has no PXE base code instance: %s\n",
		       efi_handle_name ( device ), strerror ( rc ) );
		goto err_open;
	}

	/* Do not attempt to cache IPv6 packets */
	mode = pxe.pxe->Mode;
	if ( mode->UsingIpv6 ) {
		rc = -ENOTSUP;
		DBGC ( device, "EFI %s has IPv6 PXE base code\n",
		       efi_handle_name ( device ) );
		goto err_ipv6;
	}

	/* Record DHCPACK, if present */
	if ( mode->DhcpAckReceived &&
	     ( ( rc = cachedhcp_record ( virt_to_user ( &mode->DhcpAck ),
					 sizeof ( mode->DhcpAck ) ) ) != 0 ) ) {
		DBGC ( device, "EFI %s could not record DHCPACK: %s\n",
		       efi_handle_name ( device ), strerror ( rc ) );
		goto err_record;
	}

	/* Success */
	rc = 0;

 err_record:
 err_ipv6:
	bs->CloseProtocol ( device, &efi_pxe_base_code_protocol_guid,
			    efi_image_handle, NULL );
 err_open:
	return rc;
}