12
  <   ˆl–ßi~”JC]Šq@¹q°\h*bÑ¿Æƒî_˜uÐb&=LyXÕ!#¢…Re¤IR?ÂÄ ª    #!/usr/bin/bash

# set -x

if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]
then
COMMAND="$1"
KERNEL_VERSION="$2"
#BOOT_DIR_ABS="$3"
#KERNEL_IMAGE="$4"

[ -f /etc/u-boot.conf ] && source /etc/u-boot.conf || true
[ -z "$FIRMWAREDT" ] || FirmwareDT=$FIRMWAREDT

if [[ $FirmwareDT == "True" ]]
then
	# if we want to use firmware DT we remove symlink to current kernel DT
        if [ -h /boot/dtb ]; then
            rm -f /boot/dtb
        fi
	exit 0
fi

# Setup a /boot/dtb -> /boot/dtb-$newest_kernel_version symlink so that
# u-boot can find the correct dtb to load.
#
# If invoked to 'add' a new kernel, find the newest based on `sort`ing
# the kernel versions dtb.  If 'remove', then follow basically the same
# procedure but exclude the version currently being removed.
#
# The theory of operation here is that, while newer kernels may add new
# dtb nodes and fields, as upstreaming hw support for some particular
# device progresses, it should never make backward incompatible changes.
# So it should always be safe to use a newer dtb with an older kernel.

    list_dtb_versions() {
        excluded_version="$1"
        for dtbdir in /boot/dtb-*; do
            dtbver=${dtbdir#*-}
            if [ "$dtbver" != "$excluded_version" ]; then
                echo $dtbver
            fi
        done
    }

    setup_dtb_link() {
        ver=`list_dtb_versions $1 | sort -r --sort=version | head -1`
        if [ -h /boot/dtb ]; then
            rm -f /boot/dtb
        fi
        ln -s dtb-$ver /boot/dtb
    }

    ret=0
    case "$COMMAND" in
        add)
            # If we're adding a kernel we want that version
            if [ -h /boot/dtb ]; then
                rm -f /boot/dtb
            fi
            ln -s dtb-$KERNEL_VERSION /boot/dtb
            ret=$?
            ;;
        remove)
            setup_dtb_link $KERNEL_VERSION
            ret=$?
            ;;
    esac
    exit $ret
else
    # Just exit on non ARM
    exit 0
fi
     ˆÈÇƒyÑ5ÆÂÄ "    #ifndef _LINUX_VIRTIO_RING_H
#define _LINUX_VIRTIO_RING_H
/* An interface for efficient virtio implementation, currently for use by KVM,
 * but hopefully others soon.  Do NOT change this since it will
 * break existing servers and clients.
 *
 * This header is BSD licensed so anyone can use the definitions to implement
 * compatible drivers/servers.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of IBM nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Copyright Rusty Russell IBM Corporation 2007. */
#include <stdint.h>
#include <linux/types.h>
#include <linux/virtio_types.h>

/* This marks a buffer as continuing via the next field. */
#